cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
rfeick
Level IV

Reset Button

I have a script that creates a window to recieve user input via text edit boxes and checkboxes. I want there to be three buttons in the window, one of which is a reset button that clear all the checkboxes and reset the text edit boxe back to their defaults (either blank, "---", or "mm/dd/yyyy"). I've gotten the checkbox part to work, but can't figure out how to reset the text edit boxes. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Reset Button

Here is the example taken from the  Text Edit Box() area in the Scripting Index

     Help==>Scripting Index==>Text Edit Box==>Set Text

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Edit Box( "Example Text" )
);
text << Set Text( "New Text" );
Jim

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Reset Button

The Scripting Index is the definative documentation on all of the elements that can be set, modified, etc. for any of the different functions/display objects.

Here is the JSL from the example for the setting of a check box.  The example is taken directlyu from:

      Help=>Scripting Index==>CheckBoxBox==>Set

Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box( {"One", "Two", "Three"} )
);
cb << Set( 3, 1 );
Jim
rfeick
Level IV

Re: Reset Button

You're right, the scripting index is quite helpful. I was able to use it and other resources to figure out how to reset the check boxes. However, even with the scripting index, I'm stumped as how to reset the text edit boxes. Right now I put in a work around to just close and then regenerate the whole window, but I'd like to find a better way if possible.

txnelson
Super User

Re: Reset Button

Here is the example taken from the  Text Edit Box() area in the Scripting Index

     Help==>Scripting Index==>Text Edit Box==>Set Text

Names Default To Here( 1 );
win = New Window( "Example",
	fontobj = text = Text Edit Box( "Example Text" )
);
text << Set Text( "New Text" );
Jim
Craige_Hales
Super User

Re: Reset Button

If Jim's example isn't working for you, share an example of your JSL. There's probably something else going on that a second set of eyes will see.

Button script to set text edit boxButton script to set text edit box

Craige
rfeick
Level IV

Re: Reset Button

Thanks for the help! I think somehow I missed that example when using the scripting guide.