Anyone have a quick code to mimic the "Keep dialog open" option you see in the table platforms, like 'subset'. If yes, does it work with a Modal window?
From the Scripting Index:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
obj = Fit Model(
Y( :ABRASION ),
Effects( :SILICA, :SILANE ),
Personality( Standard Least Squares )
);
obj << Keep Dialog Open( 1 );
obj << Run;
Hi msharp,
I found these two conflicting links on the topic:
This one (Page 83) says it is not very useful:
https://books.google.co.uk/books?id=42Bt1lDZLYoC&pg=PA82&lpg=PA82&dq=jsl+keep+dialog+open&source=bl&ots=rnr7dBRzZv&sig=1aAcJT94KS6DsbpLwTUzOen3xkE&hl=en&sa=X&ved=0ahUKEwj6wqXDiKDJAhXIfhoKHZakDyoQ6AEIIDAA#v=onepage&q=jsl%20keep%20dialog%20open&f=false
this one shows some use of “Keep dialog open (1)” but I am not sure it is the way you are looking for:
http://www.jmp.com/support/help/Utility_Functions.shtml
best,
ron
msharp,
It sounds like you want to add the "Keep Dialog Open" as a check box in the dialog window, right? If that's the case, here's part of a script that I've used to add one or more columns of random numbers. The script behind the "OK" button closes the window only if the check box is unchecked.
Names Default to Here( 1 );keepopen = 0;New Window( "Example", Show Menu( 0 ), Show Toolbars( 0 ), Suppress Autohide, Text Box( "Example: Keep Dialog Open Checkbox" ), Text Box( "" ), H List Box( keepcbox = Check Box( "Keep dialog open", keepopen = keepcbox << get( 1 ) ), Button Box( "OK", // Insert name of an expression to run as a script If( !keepopen, Current Window() << Close Window); ), Button Box( "Cancel", Current Window() << Close Window ) ));
Of course you would want to add more options to the dialog window (advanced example in the JMP Scripting Guide; pages 454-456). I don't think that you can add a similar check box using the older (modal) Column Dialog() method. You can make the above window modal by adding a <<Modal option, but that may require some additional tricks.
Howard
This is what I'm looking for, I just need it to work with a Modal Window since I want to force the user to respond. Any thoughts?
Actually I figured it out:
'<<Modal, <<On Close(0)'
This is bad b/c you'll end up with a window that is modal and won't close, but appending it to hlrauch's script:
Names Default to Here( 1 );
keepopen = 0;
New Window( "Example", Show Menu( 0 ), Show Toolbars( 0 ), Suppress Autohide,
<<Modal,
Text Box( "Example: Keep Dialog Open Checkbox" ),
Text Box( "" ),
H List Box(
keepcbox = Check Box( "Keep dialog open", keepopen = keepcbox << get( 1 ) ),
Button Box( "OK",
// Insert name of an expression to run as a script
If( !keepopen, Current Window() << On Close(1), Current Window() << On Close(0));
),
Button Box( "Cancel",
Current Window() << Close Window
)
Just another note, having issues with 'Current Window()' if the expression that is run creates windows. Switched it to keepcbox (or any other display in the modal window) and it should be fixed.
I am not sure what On Close(1) and On Close(0) are suposed to do here.
However, this does not work well in JMP 12.1 for Mac. If "Keep dialog open" is checked and I click "OK" an empty (non-modal) window is left behind without any obvious method to close it. And if I select "Close" in the menu JMP crash. Weird