Try this approach:
// Example.
Names Default To Here( 1 );
// Open some data tables.
Open( "$SAMPLE_DATA/Baseball.jmp" );
Open( "$SAMPLE_DATA/Basketball.jmp" );
Open( "$SAMPLE_DATA/Bicycle.jmp" );
// Get list of available tables.
tableList = {};
For( i = 1, i <= N Table(), i++,
Insert Into( tableList, Data Table( i ) )
);
New Window( "Select a table",
<<Modal,
H List Box(
Panel Box( "Select dt",
getDt = List Box(
tableList,
Max Selected( 1 ),
// delete box that's there, replace with box using the selected table
getCol << Delete Box();
pb << Append(
getCol = Col List Box(
// get selected returns a list
// you allow only one selected, so there's one item in the list
// so the first item in the list is the name of the one selected table
Data Table( (getDt << Get Selected)[1] ),
// without this, your box is blank
"all"
// can use this after "all" to restrict the columns to character or numeric
//,<<Set Data Type("numeric")
)
);
)
),
// give panel box a reference so you can append new col list boxes
pb = Panel Box( "Select columns from dt", getCol = Col List Box() )
)
);