Hello JMP Community,
I have browsed the discussion boards and this one has me stumped. I am a fairly new JSL user and am having issues passing a list to a listbox dynamically based off of a combobox selection. Utimately, I am trying to create listboxes based off of a combobox selection, but to start I am trying to simply pass a specific list dependent on a combobox selection. I have seen some examples using the combobox to update a listbox based off of table results, I am trying to simplify things further by defining explicit lists and am having issues with the listbox not reflecting new assignments to the list argument. Here is my code with some commented out sections showing my original intent and moving backwards trying to debug.
Names Default To Here( 1 );
Clear Symbols();
New Window( "Example",
H List Box(
cb1 = Combo Box(
{"<SELECT type="">", "First N Cycles", "Last N Cycles", "Cycle Interval", "Select Cycles"},
<<SETFUNCTION> 2,
Dialog("this is lame", Button("OK"))
);
*/
/*
Choose(selection,
//Select from drop down
Dialog( "Reset", Button( "OK" ) ),
//First N Cycles picked
cyclesavailable << Set Items({1,2,3,4,5,6,7}),
//Last N Cycles picked
cyclesavailable << Set Items({8,9,10,11,12,13}),
//Cycle Interval picked
Dialog( "Cycle Interval", Button( "OK" ) ),
//Select Cycles piked
Dialog( "Select Cycles", Button( "OK" ) ),
//Error Catching
Dialog( "Something went wrong with combobox cycletype", Button( "OK" ) )
);
*/
cb2 << Set Items (cyclesavailable);
)
)
),
cb2 = List Box(
{"</SETFUNCTION></SELECT><SELECT filter="" type="">"}
)
)
)</SELECT>
It seems cb2 will not update the listbox with the list that is assigned within the cb1 combobox script. Any help is greatly appreciated!
/* Slaps head */
Of course it does! Thanks for the quick reply Dave, I need to remember the basics...
BTW I really enjoyed your articles at pega analytics, they helped me get up and running (until this one).
The list you are assigning needs to contain string items:
cyclesavailable = {"1","2","3","4","5","6","7"};