cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
olmadriaga
Level I

Trouble extracting text from a Text Edit Box JMP 16.1

I am having trouble extracting text from the Text Edit Box in JMP 16.1.  When running the script below, the text that is entered by the user does not show up in the field "title".

 

 

maintitle = New Window("Project Name",
	<<Modal,
	Text Box("Enter Project Name for Reports. "),
	PNAME = Text Edit Box("Project Name", set width(80)),
	title = (PNAME << get text() ; ),
	Button Box("OK"),
	Button Box("Cancel")
);
Show(title);   

// This does not work;

 

2 REPLIES 2
jthi
Super User

Re: Trouble extracting text from a Text Edit Box JMP 16.1

Move your title part inside OK button box

Names Default To Here(1);

maintitle = New Window("Project Name",
	<<Modal,
	Text Box("Enter Project Name for Reports. "),
	PNAME = Text Edit Box("Project Name", set width(80)),
	Button Box("OK",
		title = PNAME << get text()
	),
	Button Box("Cancel")
);
Show(title);   

Other option would be to use Return Result with modal window (I think this was already in JMP16)

Names Default To Here(1);

maintitle = New Window("Project Name", << return result, <<Modal,
	Text Box("Enter Project Name for Reports. "),
	PNAME = Text Edit Box("Project Name", set width(80)),
	Button Box("OK"),
	Button Box("Cancel")
);
title = maintitle["PNAME"];
Show(title);   
-Jarmo
jthi
Super User

Re: Trouble extracting text from a Text Edit Box JMP 16.1

Or if you wish to update it all the time, you can move it to Text Edit Box and add << Script, but I would suggest collecting the results either inside the OK button press or with return result (remember to also check that user pressed OK to close the modal window if you need that).

Names Default To Here(1);

maintitle = New Window("Project Name",
	<<Modal,
	Text Box("Enter Project Name for Reports. "),
	PNAME = Text Edit Box("Project Name", 
		<< Set Script(title = PNAME << get text()),
		<< set width(80)
	),
	Button Box("OK"),
	Button Box("Cancel")
);
Show(title);   

Edit: Link to Scripting Guide https://www.jmp.com/support/help/en/18.0/#page/jmp/construct-display-boxes-for-new-windows.shtml#ww8...

-Jarmo