Reset Text Edit Box to empty via JSLI would like to reset the Text Edit Box to empty using the reset button in the script below. How to do this?
Names Default To Here( 1 );
clear log ();
nw = New Window( "Get Data",
<<MODAL></MODAL>
Automation and ScriptingRe: Reset Text Edit Box to empty when rest button is pressedYou can do this with the <
Names Default To Here( 1 );
clear log ();
nw = New Window( "Get Data",
<<MODAL></MODAL>
Re: Reset Text Edit Box to empty when rest button is pressed@mmarchandTSI That is simple. Thanks. While, we are here, How would one reset a List Box if it was populated with a list of items?
Re: Reset Text Edit Box to empty when rest button is pressedAs in clear the selection in the list box or clear the items leaving none to select? If you'd like to know what messages any certain display box can take, try
Show Properties( diplayboxname )
Re: Reset Text Edit Box to empty when rest button is pressed@mmarchandTSI needs to be clear the items leaving none to select.
(Sorry should have been more specific in my last post)
Re: Reset Text Edit Box to empty when rest button is pressed
lb << Remove All;
(My List Box is named lb)
I found this using
Show Properties( lb )
It's very helpful in situations like this.

Re: Reset Text Edit Box to empty when rest button is pressed<< Remove All () does empty the list.
Re: Reset Text Edit Box to empty when rest button is pressedThis should work:
New Window( "Example",
lb =
List Box(
{"First Item", "Second Item", "Third Item"},
max selected( 2 ),
)
);
lb << Set Selected( 2 );
lb << Set Selected( 3 );
selected items = (lb << Get Selected Indices);
for each({index},selected items, lb<< set selected (index, 0) )Re: Reset Text Edit Box to empty when rest button is pressedRemove All

Clear Selection

In this case (definitely not always the case) both are documented in scripting index with working examples (remove all example is quite clunky as it doesn't use wait to let user see what it does).
Easiest way (in my opinion) to find these is to search for ListBox and then from "Item name matches" try different List Box options AND check from left side until you get the correct object (in this case it is ListBoxBox, you might have to do this by trial and error and experience of using scripting index).

After you have the correct object clicked, CLEAR your search text and press enter. You end up with the messages related to that object

It does take some time to learn, how to use, scripting index in different ways of searching for information (it is worth it if you do JMP scripting).
Re: Reset Text Edit Box to empty when rest button is pressedShow Properties ()
is one of the best piece of advice I have received here. Many thanks.
Re: Reset Text Edit Box to empty when rest button is pressed@jthi Thanks. A related question. How to disable my Reset button until an entry is made in the text edit box (and enable it only after the first character entry in the text edit box)?
Re: Reset Text Edit Box to empty when rest button is pressedYou can disable display boxes using << Enable(0) and set it to 1 when it can be modified and then use << Set Text Changed or << Set function with text edit box
Names Default To Here(1);
win = New Window("Example",
teb = Text Edit Box("", << Set Text Changed(function({this, value},
btn << Enable(!IsMissing(value));
))),
btn = Button Box("OK", << Enable(0))
);Re: Reset Text Edit Box to empty when rest button is pressed
@jthi wrote:It does take some time to learn, how to use, scripting index in different ways of searching for information (it is worth it if you do JMP scripting).
Thanks for highlighting it.
I set up a quite similar rule some while ago:
https://community.jmp.com/t5/Discussions/JMP-Scripting-Index-feedback-and-discussion/m-p/583011/highlight/true#M78920
but seems that I don't stick to it.
clear selection - nice 