Interested in knowing if there is a method to automatically close a window containing a report when the datatable is closed, specifically using the "<< On Close" message? For example, I create a distribution from a datatable and add the results to a window along with some other important info. If the user closes the data table, I would like to perform some actions on the window. The following demonstrates:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
VLB = VlistBox(
Distribution(Column(:Age, :Weight));
);
win = New Window("Results",
TextBox("Other things"),
VLB
);
dt << On Close(
Show("Close script activated"); //this line is executed...
VLB << Delete Box(); //...but not this one or any following it.
Show("Remainder of script is not run...");
);
Using the "<< On Close" message would seem to be the answer, but I can't get it to work yet. When I close the table dt, the first line of the on-close script executes, but not the remainder. I get a message indicating other report windows are open and if I want to close them (clicking "Close All" closes the entire result window, not just the distribution), and finally a message asking to save ("No"). My suspicion is that when the "X" is clicked to close the table, my reference to VLB is deleted before the On-Close script can be executed.
I realize I could create a report of the distribution and put that in my window instead, but then it would be static, which I do not want.
Any thoughts?