Part of my App's GUI has a button that opens a table, and a Col List Box that I need to populate with columns from that table.
If I open the table first and then create Col Lis Box as in this modified Example from Scripting Index, everything works fine:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Col List Box Example",
lb = Col List Box()
);
lb << Append (dt << Get Column Names);
However, if I create the window with GUI that has button to open the table, i.e. I create Col List Box first and then open the table, it stops working. This is a simplified version of real code but it has the same problem - Col List Box does not populate with column names.
Names Default To Here( 1 );
open = Expr(dt = Open( "$SAMPLE_DATA/Big Class.jmp" ); lb << Append (dt << Get Column Names););
gui = Expr(V List Box(btn = Button Box ("OPEN", open), lb = Col List Box()));
New Window( "Col List Box Example",
gui;
);
What am I doing wrong? How can I make it work?