Does someone have an idea if I'm doing something wrong with New Window() <<modal and <<return result with Col List Boxes? Or is this possibly a bug or undocumented behaviour due to New Window(<<modal, << return result)) replacing Dialog() function?
I cannot get results from Filter Col Selector and Col List Boxes when using << return result and have to get values with <<on close, when button is pressed or set additional scripts to display boxes which would update values (which I wouldn't want to do and I don't want to use Column Dialog() either due to its lack of customisation).
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("Split", Show Menu(0), Show Toolbars(0), <<Modal,
<<Return Result,
<<On Close(nw_result = Associative Array({"clb_by", "clb_split"}, Eval List({clb_by << get items, clb_split << get items})));
V List Box( Align("right"),
H List Box(
teb = Text Edit Box("maybe this works"),
Panel Box("", fcl = Filter Col Selector(Data Table(dt), all, nlines(10))),
Panel Box("",
H List Box(
Spacer Box(size(0, 164)),
Lineup Box(N Col(2),
Button Box("Split By", clb_by << append(fcl << get selected)),
clb_by = Col List Box(<<Modeling Type({"Nominal", "Ordinal"}), min items(1), nlines(4)),
Button Box("Columns to split", clb_split << append(fcl << get selected)),
clb_split = Col List Box(Data Table(dt), <<Set Data Type("Numeric"), min items(1), nlines(2)),
)
)
)
),
H List Box(
Button Box("OK", nw_result_btn = Associative Array({"clb_by", "clb_split"}, Eval List({clb_by << get items, clb_split << get items}))),
Button Box("Cancel")
)
);
);
Show(nw, nw_result, nw_result_btn);
Return result(nw) will return empty lists, On Close(nw_result) and button (nw_result_btn) seems to get the values as I would expect.
nw = {teb = "maybe this works", fcl = Empty(), clb_by = {}, clb_split = {}, Button(1)};
nw_result = ["clb_by" => {"name", "sex"}, "clb_split" => {"weight", "height"}];
nw_result_btn = ["clb_by" => {"name", "sex"}, "clb_split" => {"weight", "height"}];
Not the first one with this problem.
-Jarmo