Just expanding a bit on john.ponte's post. This is an example I received from WK and have modified often.
/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Extract a list of unique ages */
Summarize( a = By( :age ) );
Insert Into( a, "<Select Age>", 1 );
/* Create a modal dialog */
New Window( "Example",
<<Modal,
H List Box(
/* Upon selecting an age, populate the second ComboBox with corresponding names */
Panel Box( "Select an Age:",
cb1 = Combo Box(
a,
<<SetFunction(
Function( {this},
selection = this << Get Selected();
r = dt << Get Rows Where( :age == Num( selection ) );
ageNames = :name;
Insert Into( ageNames, "<Select Name>", 1 );
cb2 << Set Items( ageNames );
)
)
)
),
/* Print the selected values from both ComboBoxes in the log */
Panel Box( "Select a Name:",
cb2 = Combo Box(
{"<Select Name>"},
<<SetFunction(
Function( {this},
that=this<< Get Selected();
Print( selection, that )
)
)
)
)
)
);
sel=num(selection)