Modal window, return result and Filter Col Selector/Col List BoxDoes someone have an idea if I'm doing something wrong with New Window() <<
I cannot get results from Filter Col Selector and Col List Boxes when using << return result and have to get values with <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></MODAL>

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.
Automation and ScriptingConsumer and Market ResearchContent OrganizationQuality and Process EngineeringSharing and Communicating ResultsRe: Modal window, return result and Filter Col Selector/Col List BoxI always put result assignments into the script section of an OK button box. More control that way.
Re: Modal window, return result and Filter Col Selector/Col List BoxI have two problems with the current << return result:
- It changes the modal to act like deprecated Dialog() function, but haven't used JMP long enough to have used Dialog(), so I don't really know the behavior (and not really sure if i like to start going through all deprecated functions to understand what current ones do). Quickly checking JMP16 scripting guide's comparison between Dialog and << return result new window... I'm happy that the dialog is gone an I can use just New window (with or without << return result).
- Other is that I would like to have elements behave similarly. Of course this isn't as simple because display boxes will return different values depending what message you use( << get, << get selected, << get text, << get items, << get selected indices...). So this maybe would have to be implemented into the display box so user can choose the "default return"?
I really like using << return result for quick modals, but I might (try to) go back to one of the other methods which will always work, so I can keep my code similar between different modals (simple and complicated).
Some further testing, return results seems to return selected values in Col List Boxes (but not for filter col box):
View more...
For now I think I will continue with either getting values with Button Box() or getting values with << On Close().
Re: Modal window, return result and Filter Col Selector/Col List BoxThere are two other methods supported for the extraction of values from the window. Perhaps << Return Result is not the best choice for this case.]
JMP Help: Extract Values
Re: Modal window, return result and Filter Col Selector/Col List BoxAgree, those boxes are not being as helpful as they should be. Somebody (at JMP) has to decide what each type of box should be returning. Since it can't return the box, some part(s) of the box's data have to be selected.
Edit: I sent JMP a note.
Re: Modal window, return result and Filter Col Selector/Col List BoxThe << Return Result message causes the modal window to act like the old deprecated Dialog() function. The current 'values' in the display boxes are saved for you in the assigned variables. So myNEB = Number Edit Box( 42 ) in my script will result in the assignment of the current value to myNEB when I click OK to dismiss the window.
Re: Modal window, return result and Filter Col Selector/Col List BoxNot nice but useful as a workaround - to get consistent return values from the window.
Button Box( "OK",
// the modal dialog stores the selected columns.
For Each( {item}, 1 :: N Items( clb_by<< Get Items() ), clb_by<< Set Selected( item, 1 ) );
),
With even less effort, one could go for
Button Box( "OK", clb_by_ = clb_by<< Get Items() )
and use clb_by_ afterwards, instead of nw["clb_by"]
@Craige_Hales , what was the response / suggestion from JMP?
Re: Modal window, return result and Filter Col Selector/Col List BoxThe Filter Col Selector bug should be fixed in Jmp 20. Instead of returning nothing to << return result it will start returning the selected items which will make it match other list controls.
If anything other than the selected items are needed from a Col List Box then I agree with earlier replies that the ButtonBox callback, <<ON close=""></ON>, or <<ON validate="">are better choices for result processing.</ON>
Re: Modal window, return result and Filter Col Selector/Col List Boxgreat, thanks.