Quickly looking at this there are two things that must be taken care of when using Filter Col Selector:
- It seems like Filter Col Selector always uses the Current Data table() and you cannot give it direct reference to the datatable you want to use. Based on the Scripting Index it should accept Datatable(name) as argument so most likely a bug (at least in JMP16.1).
- The red triangle of Filter Col Box is a different DisplayBox which has to be deleted.
To work around the reference thing you could try changing the Current Data Table() based on the user selection and to delete also the red triangle, you can wrap Filter Col Box around V List Box and delete that.
Names Default To Here(1);
//get a list of window names
windows = Get Data Table List();
/*remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
*/
//make a dialog window
nw = New Window("Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try(vlb2 << delete);
//append a new v list box which includes filter col selector
Current Data Table(Data Table((lb1 << get selected)[1]));
vlb1 << append(vlb2 = V List Box(Filter Col Selector()));
)
)
);
Also here is simple script to replicate the issue with Filter Col Selector:
Names Default To Here(1);
//Open two data tables
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Consumer Preferences.jmp");
//Make sure the one not used in filter col selector is current data table
Current Data Table(dt2);
wait(0);
//Create filter col selector with non current data table
New Window("Filter Col Selector Example",
fontobj = lb = Filter Col Selector(Data table("Big Class"))
);
-Jarmo