Selection without "OK" confirmation.Hello Everybody,
I am new in JSL scripting and I have one issue. Namely, having one selection list (Processes) I would like to select (by mouse) one parameter and display corresponding list of parameters/values from another list without confirming the previous "process" selection (for example by clicking button OK).
I would appreciate for hints how to solve that.
Best regards.
New Window("Example",
H List Box(
unique_process_list = {"Process_1", "Process_2", "Process_3"};
Panel Box("Process",
processes = List Box( unique_process_list, max selected( 1 ) ),
//Button Box( "OK",
// process = processes << get selected ),
),
Spacer Box(Size(20, 10)),
parameter_list_1 = {"parameter_1", "parameter_2", "parameter_3"}; //for Process 1
parameter_list_2 = {"parameter_4", "parameter_5", "parameter_6"}; //for Process 2
parameter_list_3 = {"parameter_7", "parameter_8", "parameter_9"}; //for Process 3
Panel Box("Parameters",
runs = List Box( parameter_list_1),
),
),
)Re: Selection without "OK" confirmation.You can include a script to be executed as selections are changed in your List Box.
Something like this:
unique_process_list = {"Process_1", "Process_2", "Process_3"};
params_lists = {{"parameter_1", "parameter_2", "parameter_3"},
{"parameter_4", "parameter_5", "parameter_6"},
{"parameter_7","parameter_8", "parameter_9"}};
New Window( "Example",
H List Box(
Panel Box( "Process",
processes = List Box(
unique_process_list,
max selected( 1 ),
selected_item = (processes << get selected indices)[1];
Show( selected_item[1] );
selected_params_list = params_lists[selected_item];
Show( selected_params_list );
params << set items( selected_params_list );
),
//Button Box( "OK",
// process = processes << get selected ),
),
Spacer Box( Size( 20, 10 ) ),
params = List Box(),
),
);
Re: Selection without "OK" confirmation.The script that you are attempting to run is outside of the definition of the List Box(), and therefore, JMP does not recognize it as a script to run when the List Box() changes.
processes = List Box( unique_process_list, max selected( 1 ) ),
show( Processes << get selected ),
The change is very simple, move the script you want to execute when something in the List Box() changes, into the last referenced item in the list of List Box() elements
processes = List Box( unique_process_list, max selected( 1 ),
show( Processes << get selected );
),
Look in the Scripting Index uner "listboxbox" for examples
Re: Selection without "OK" confirmation.Thank you very much for your reply! Problem solved.
Re: Selection without "OK" confirmation.Thank you very much for your reply! Problem solved.