Hi all,
I just encountered 2 problems with my script in a Modal Window which used to be working fine in JMP14 but as soon as I moved over JMP16, these 2 problems were found:
1) There's an error message came out stating "deleted object reference: cc << Get Selected in access or evaluation of 'Glue',....."
2) "Cancel" button shows an error " Name Unresolved: Button in access or evaluation of 'Button', Button (-1) /*###*/ "
Below is a simplified script that is working fine in JMP14 but not in JMP16. If working correctly, the script will create a New column ("Result") stating "Pass" if the checkbox is checked, but a "Fail" if the checkbox is unchecked. About the "Cancel" button, if working properly, there'll be no error message when clicked, where it will close the Modal Window.
Names Default To Here( 1 );
dt = Current Data Table ();
win = New Window( "User Input", << Modal, LineUpBox( Ncol( 1 ),
cchk = {"Pass"};
PanelBox( "Result",
cc = Checkbox(cchk),
cc << Set( 1, 1 ),
SpacerBox( Size( 1, 0 ) )),
HListBox( SpacerBox(), ButtonBox( "OK" ), ButtonBox( "Cancel" )),
));
If( win["Button"] == -1, win << Close Window );
ctc = cc << Get Selected;
dt << New Column ("Result", character, nominal);
If (Contains (ctc, "Pass"),
dt:Result << Set Each Value ("Pass"),
dt:Result << Set Each Value ("Fail"));
In general I've found that JMP16 is a bit more aggressive about deleting display boxes immediately.
However, the way that I've always used Modal windows is by utilizing the OnValidate function -- this is typically reserved for determining whether the window should close (perhaps not all required inputs are filled out and you don't want the window to close via the 'OK' button.) Just be sure to return a 1 for proper window closing.
Names Default To Here( 1 );
dt = Current Data Table();
win = New Window( "User Input",
<<MODAL></MODAL>
Hi, really sorry for the late reply. I have been busy with work for the past 2 weeks. Thanks for the solution. It works and I learnt something new. Appreciate that !