cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
brandon_mcrv
Level II

Script used to work in JMP14 but not working in JMP16

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,
	Lineup Box( N Col( 1 ), 

		cchk = {"Pass"};

		Panel Box( "Result",
			cc = Check Box( cchk ),
			cc << Set( 1, 1 ),
			Spacer Box( Size( 1, 0 ) )
		);, 

		H List Box( Spacer Box(), Button Box( "OK" ), Button Box( "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" )
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ErraticAttack
Level VI

Re: Script used to work in JMP14 but not working in JMP16

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
,
	<<On Validate(
		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" )
		);
		1
	)
,
	Lineup Box( N Col( 1 ), 
		cchk = {"Pass"};
		Panel Box( "Result",
			cc = Check Box( cchk, << Set( 1, 1 ) ),
			Spacer Box( Size( 1, 0 ) )
		)
	,
		H List Box(
			Button Box( "OK" )
		,
			Spacer Box( <<Set Auto Stretching( 1, 0 ) )
		,
			Button Box( "Cancel" )
		)
	)
);

 

Jordan

View solution in original post

2 REPLIES 2
ErraticAttack
Level VI

Re: Script used to work in JMP14 but not working in JMP16

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
,
	<<On Validate(
		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" )
		);
		1
	)
,
	Lineup Box( N Col( 1 ), 
		cchk = {"Pass"};
		Panel Box( "Result",
			cc = Check Box( cchk, << Set( 1, 1 ) ),
			Spacer Box( Size( 1, 0 ) )
		)
	,
		H List Box(
			Button Box( "OK" )
		,
			Spacer Box( <<Set Auto Stretching( 1, 0 ) )
		,
			Button Box( "Cancel" )
		)
	)
);

 

Jordan
brandon_mcrv
Level II

Re: Script used to work in JMP14 but not working in JMP16

 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 !