cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

Get a New Window with exsisting radiobuttons

Hello JMP Community,

I am new to JMP. I have a doubt. So below attached is my code, When I select combo box button and select a shape and click ok then a new window should pop up by only highlighting required columns. for example, if I select L-shape from ShapeChoice, the new window should pop up with all the given HL,VL,HH, VH, BL,UL, etc.. but only give the option to input the values only for HL,HW,HH,VL,VW,and VH.Can you please help me out. Thank you in advance.

Names Default To Here( 1 );
dlg = New Window("Dimensions",
	<<Modal,
	<<Return Result,
	V list Box(
		Text Box(" "),
		Text Box("Please select the units information: " ),
		ComboChoice = RadioBox({"Ft","m"}),
		ShapeChoice = Combobox({"Rectangle/Square", "L-Shape", "U-Shape", "Oval"}),
		Text Box(""),
	),
	V list box(
		Text Box("Please enter the following information: " ),
		Text Box("Horizontal Length"),hl_box = Number Edit Box(0),
		Text box("Horizontal Width"), hw_box = Number Edit Box(0),
		Text Box("Horizontal Height"), hh_box = Number Edit Box(0),
		Text box("Vertical Length"),vl_box = Number Edit Box(0),
		Text Box("Vertical Width"), vw_box = Number Edit Box(0),
		Text Box("Vertical Height"),vh_box = Number Edit Box(0),
		Text box("Bottom Length"),bl_box = Number Edit box(0),
		Text Box("Bottom Width"), bw_box = Number Edit Box(0),
		Text Box("Bottom Height"), bh_box = Number Edit Box(0),
		Text box("upper Length"),ul_box = Number Edit box(0),
		Text Box("upper Width"), uw_box = Number Edit Box(0),
		Text Box("upper Height"), uh_box = Number Edit Box(0),
	),
	H List Box(
		Button Box("Ok",
			ShapeChoice = ShapeChoice << Get;
			ComboChoice = ComboChoice << Get;
			hl = hl_box << Get;
			hw = hw_box << Get;
			hh = hh_box << Get;
			vl = vl_box << Get;
			vw = vw_box << Get;
			vh = vh_box << Get;
			bl = bl_box << Get;
			bw = bw_box << Get;
			bh = bh_box << Get;
			ul = ul_box << Get;
			uw = uw_box << Get;
			uh = uh_box << Get;	
		),
		Button Box("Cancel"),
	),
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Get a New Window with exsisting radiobuttons

Here is the approach I would take

Names Default To Here( 1 );


hideAll = Function( {},
	tb1 << visibility("collapse");
	tb2 << visibility("collapse");
	tb3 << visibility("collapse");
	tb4 << visibility("collapse");
	tb5 << visibility("collapse");
	tb6 << visibility("collapse");
	tb7 << visibility("collapse");
	tb8 << visibility("collapse");
	tb9 << visibility("collapse");
	tb10 << visibility("collapse");
	tb11 << visibility("collapse");
	tb12 << visibility("collapse");
	hl_box << visibility("collapse");
	hw_box << visibility("collapse");
	hh_box << visibility("collapse");
	vl_box << visibility("collapse");
	vw_box << visibility("collapse");
	vh_box << visibility("collapse");
	bl_box << visibility("collapse");
	bw_box << visibility("collapse");
	bh_box << visibility("collapse");
	ul_box << visibility("collapse");
	uw_box << visibility("collapse");
	uh_box << visibility("collapse");
	comboVal = (ShapeChoice << get items)[ShapeChoice << get];
	If( comboVal == "Rectangle/Square",
		tb1 << visibility("Visible");
		hl_box << visibility("Visible");
		tb4 << visibility("Visible");
		vl_box << visibility("Visible");
	,
		comboVal == "L-Shape",
		tb1 << visibility("Visible");
		hl_box << visibility("Visible");
		tb2 << visibility("Visible");
		hw_box << visibility("Visible");
		tb3 << visibility("Visible");
		hh_box << visibility("Visible");
		tb4 << visibility("Visible");
		vl_box << visibility("Visible");
		tb5 << visibility("Visible");
		vw_box << visibility("Visible");
		tb6 << visibility("Visible");
		vh_box << visibility("Visible");
	)
);

// This Expr is where all of the script is placed that is to be run after the user
// clicks on OK in the Dimensions data entry window
runtherest = Expr( 

);


dlg = New Window("Dimensions",
	//<<Modal,
	<<Return Result,
	V list Box(
		Text Box(" "),
		Text Box("Please select the units information: " ),
		ComboChoice = RadioBox({"Ft","m"}),
		ShapeChoice = Combobox({"Rectangle/Square", "L-Shape", "U-Shape", "Oval"}, hideAll),
		Text Box(""),
	),
	V list box(
		Text Box("Please enter the following information: " ),
		tb1 = Text Box("Horizontal Length"),hl_box = Number Edit Box(0),
		tb2 = Text box("Horizontal Width"), hw_box = Number Edit Box(0),
		tb3 = Text Box("Horizontal Height"), hh_box = Number Edit Box(0),
		tb4 = Text box("Vertical Length"),vl_box = Number Edit Box(0),
		tb5 = Text Box("Vertical Width"), vw_box = Number Edit Box(0),
		tb6 = Text Box("Vertical Height"),vh_box = Number Edit Box(0),
		tb7 = Text box("Bottom Length"),bl_box = Number Edit box(0),
		tb8 = Text Box("Bottom Width"), bw_box = Number Edit Box(0),
		tb9 = Text Box("Bottom Height"), bh_box = Number Edit Box(0),
		tb10 = Text box("upper Length"),ul_box = Number Edit box(0),
		tb11 = Text Box("upper Width"), uw_box = Number Edit Box(0),
		tb12 = Text Box("upper Height"), uh_box = Number Edit Box(0),
	),
	H List Box(
		Button Box("Ok",
			ShapeChoice = comboVal;
			ComboChoice = (comboChoice << get items)[comboChoice << get];
			hl = hl_box << Get;
			hw = hw_box << Get;
			hh = hh_box << Get;
			vl = vl_box << Get;
			vw = vw_box << Get;
			vh = vh_box << Get;
			bl = bl_box << Get;
			bw = bw_box << Get;
			bh = bh_box << Get;
			ul = ul_box << Get;
			uw = uw_box << Get;
			uh = uh_box << Get;	
			dlg << close window;
			runtherest;
		),
		Button Box("Cancel",
			dlg << close window;
			Throw();
		),
	),
);
hideAll;
Jim

View solution in original post

6 REPLIES 6
jthi
Super User

Re: Get a New Window with exsisting radiobuttons

You might want to take a look at IfBox. This recent post might also give some ideas How to hide\unhide GUI elements effectively? 

-Jarmo

Re: Get a New Window with exsisting radiobuttons

Thank you for help but I also need a user input option to it.

jthi
Super User

Re: Get a New Window with exsisting radiobuttons

So you could use If Boxes which you set to 0/1 based on user selection?

-Jarmo

Re: Get a New Window with exsisting radiobuttons

Didn't understand. I'm sorry but I am new to this. So can you explain me Thank you!

jthi
Super User

Re: Get a New Window with exsisting radiobuttons

I have to first better understand what you want to have. When user selects the shape, which number edit boxes should appear?

-Jarmo
txnelson
Super User

Re: Get a New Window with exsisting radiobuttons

Here is the approach I would take

Names Default To Here( 1 );


hideAll = Function( {},
	tb1 << visibility("collapse");
	tb2 << visibility("collapse");
	tb3 << visibility("collapse");
	tb4 << visibility("collapse");
	tb5 << visibility("collapse");
	tb6 << visibility("collapse");
	tb7 << visibility("collapse");
	tb8 << visibility("collapse");
	tb9 << visibility("collapse");
	tb10 << visibility("collapse");
	tb11 << visibility("collapse");
	tb12 << visibility("collapse");
	hl_box << visibility("collapse");
	hw_box << visibility("collapse");
	hh_box << visibility("collapse");
	vl_box << visibility("collapse");
	vw_box << visibility("collapse");
	vh_box << visibility("collapse");
	bl_box << visibility("collapse");
	bw_box << visibility("collapse");
	bh_box << visibility("collapse");
	ul_box << visibility("collapse");
	uw_box << visibility("collapse");
	uh_box << visibility("collapse");
	comboVal = (ShapeChoice << get items)[ShapeChoice << get];
	If( comboVal == "Rectangle/Square",
		tb1 << visibility("Visible");
		hl_box << visibility("Visible");
		tb4 << visibility("Visible");
		vl_box << visibility("Visible");
	,
		comboVal == "L-Shape",
		tb1 << visibility("Visible");
		hl_box << visibility("Visible");
		tb2 << visibility("Visible");
		hw_box << visibility("Visible");
		tb3 << visibility("Visible");
		hh_box << visibility("Visible");
		tb4 << visibility("Visible");
		vl_box << visibility("Visible");
		tb5 << visibility("Visible");
		vw_box << visibility("Visible");
		tb6 << visibility("Visible");
		vh_box << visibility("Visible");
	)
);

// This Expr is where all of the script is placed that is to be run after the user
// clicks on OK in the Dimensions data entry window
runtherest = Expr( 

);


dlg = New Window("Dimensions",
	//<<Modal,
	<<Return Result,
	V list Box(
		Text Box(" "),
		Text Box("Please select the units information: " ),
		ComboChoice = RadioBox({"Ft","m"}),
		ShapeChoice = Combobox({"Rectangle/Square", "L-Shape", "U-Shape", "Oval"}, hideAll),
		Text Box(""),
	),
	V list box(
		Text Box("Please enter the following information: " ),
		tb1 = Text Box("Horizontal Length"),hl_box = Number Edit Box(0),
		tb2 = Text box("Horizontal Width"), hw_box = Number Edit Box(0),
		tb3 = Text Box("Horizontal Height"), hh_box = Number Edit Box(0),
		tb4 = Text box("Vertical Length"),vl_box = Number Edit Box(0),
		tb5 = Text Box("Vertical Width"), vw_box = Number Edit Box(0),
		tb6 = Text Box("Vertical Height"),vh_box = Number Edit Box(0),
		tb7 = Text box("Bottom Length"),bl_box = Number Edit box(0),
		tb8 = Text Box("Bottom Width"), bw_box = Number Edit Box(0),
		tb9 = Text Box("Bottom Height"), bh_box = Number Edit Box(0),
		tb10 = Text box("upper Length"),ul_box = Number Edit box(0),
		tb11 = Text Box("upper Width"), uw_box = Number Edit Box(0),
		tb12 = Text Box("upper Height"), uh_box = Number Edit Box(0),
	),
	H List Box(
		Button Box("Ok",
			ShapeChoice = comboVal;
			ComboChoice = (comboChoice << get items)[comboChoice << get];
			hl = hl_box << Get;
			hw = hw_box << Get;
			hh = hh_box << Get;
			vl = vl_box << Get;
			vw = vw_box << Get;
			vh = vh_box << Get;
			bl = bl_box << Get;
			bw = bw_box << Get;
			bh = bh_box << Get;
			ul = ul_box << Get;
			uw = uw_box << Get;
			uh = uh_box << Get;	
			dlg << close window;
			runtherest;
		),
		Button Box("Cancel",
			dlg << close window;
			Throw();
		),
	),
);
hideAll;
Jim