Need Help - behavior of "Set Script" changed for column switcher in JMP 15If you set a script for column switcher, in JMP 14 the script runs after the column switching is completed, but in JMP 15 it runs before the column switching.
The following example creates a graph builder plot with a column switcher, and sets the column switcher script to print the JMP version and the Y-axis title.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = new window("Test",
gb = Graph Builder(
Size( 528, 464 ),
Show Control Panel( 0 ),
Variables( X( :name ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Column Switcher( :height, {:height, :weight} )
)
);
nw[Listboxbox( 1 )] << set script(
print(JMP Version());
print(report(gb)[TextEditBox(4)]<< Get Text());
);
If you run the script in JMP 14 and click on "weight", you get the following output. The script runs after the column has switched.
"14.1.0"
"weight"
However, if you run the same script in JMP 15, the output is different. The script runs before the column switching has happened.
"15.1.0"
"height"
This change of behavior breaks one of my JMP scripts that set the axis min/max after switching column. Any way to force the script to run after column switching in JMP 15? Thanks.
Re: Need Help - behavior of "Set Script" changed for column switcher in JMP 15I submitted this issue to JMP support and got their reply:
The development team was able to determine that the change in the event behavior was intentional.
For now, you can use the workaround that Jim Nelson suggested on the community. However, a new approach is planned for the next maintenance release of JMP 15 that will allow you to set a script to the Column Switcher reference. This will ensure that the script is run at the proper time. We expect this feature to be available in the July time frame.
Re: Need Help - behavior of "Set Script" changed for column switcher in JMP 15@paul_vezzetti Thank you for your reply, but unfortunately, being able to read the new column name doesn't mean the plot has been updated with the new column. In JMP 15, the column switching still happens after the script execution although the new column name can be read from the column switcher. So in my usage case I want to set the axis scale for the new column being switched to, and this won't work because JMP switches to the new column after I set the scale, which totally resets the axis.
Re: Need Help - behavior of "Set Script" changed for column switcher in JMP 15You could also try this:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "Test",
gb = Graph Builder(
Size( 528, 464 ),
Show Control Panel( 0 ),
Variables( X( :name ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Column Switcher( :height, {:height, :weight} )
)
);
nw[Listboxbox( 1 )] << set script(
Print( JMP Version() );
Print( nw[Listboxbox( 1 )] << Get Selected() );
);
Re: Need Help - behavior of "Set Script" changed for column switcher in JMP 15Thank you! This solution works in both JMP 14 and 15.Re: Need Help - behavior of "Set Script" changed for column switcher in JMP 15I would put your issue into JMP Support, to get JMP;s official reason for the change, however, if you attach the script to the frame box, you will get the results you want
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = new window("Test",
gb = Graph Builder(
Size( 528, 464 ),
Show Control Panel( 0 ),
Variables( X( :name ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Column Switcher( :height, {:height, :weight} )
)
);
nw[framebox( 1 )] << add graphics script(
print(JMP Version());
print(report(gb)[TextEditBox(4)]<< Get Text());
);