cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Georgios_Tsim
Level III

add another layer of Edit boxes Button

Hi 

 

I would like to create an add in that compares different Sampling Plans using the OC curves. I would like to allow the user to add many input layers/Lines using an "Add more" button. (See picture below)

Georgios_Tsim_0-1746793978751.png

Therefore

The part of my script that I am focused on is:

ob1 = Outline Box( "Type in your own parameter values", 
			 H List Box(
				H List Box( Text Box( "LQ:" , << set width(20)), neb_LQ = Number Edit Box(LQ, << set function(_expr) )),
				Spacer box(Size(20,20)),
				H List Box( Text Box( "Batch size (N):" , << set width(80)), neb_N = Number Edit Box(N_batch , << set function(_expr))),
				Spacer box(Size(20,20)),
				//H List Box( Text Box( "LQ:" , << set width(20)), neb_LQ = Number Edit Box(LQ, << set function(_expr) )),
				//Spacer box(Size(20,20)),
				H List Box( Text Box( "Acceptance limit (Ac):" , << set width(120)), neb_Ac = Number Edit Box(Ac, << set function(_expr))),
				Spacer box(Size(20,20)),
				H List Box( Text Box( "Alpha:" , << set width(120)), neb_alpha = Number Edit Box(alpha, << set function(_expr)))
			)		
		),
	);
	// collapse the outline boxes
	Button Box( "Press Me",ADD_button() )

Do you have any advice of a smart way to implement the above?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: add another layer of Edit boxes Button

This is very quickly thrown together

Names Default To Here(1);

lub_expr = Expr(ob1 << Append(Lineup Box(N Col(8), Spacing(10),
	Text Box("LQ:", <<set width(20)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Batch size (N):", <<set width(80)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Acceptance limit (Ac):", <<set width(120)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Alpha:", <<set width(120)), 
	Number Edit Box(1, <<set function(_expr))
)));
nw = New Window("",
	ob1 = Outline Box("Type in your own parameter values",
		
	),
	Button Box("Press Me", lub_expr)
);

Using Table Box with Col boxes could result in cleaner UI

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: add another layer of Edit boxes Button

What should happen when the user presses "Add more" button? Some new elements should be created? What should those elements do? Are those functionalities already implemented in such a way, that they work with any number of elements?

-Jarmo
Georgios_Tsim
Level III

Re: add another layer of Edit boxes Button

Just create another line that the user will be able to import a second LQ, N, Ac, and Alpha value and saves them in a list so that I can then use the values to plot multiple OC curves.

jthi
Super User

Re: add another layer of Edit boxes Button

This is very quickly thrown together

Names Default To Here(1);

lub_expr = Expr(ob1 << Append(Lineup Box(N Col(8), Spacing(10),
	Text Box("LQ:", <<set width(20)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Batch size (N):", <<set width(80)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Acceptance limit (Ac):", <<set width(120)), 
	Number Edit Box(1, <<set function(_expr)),
	Text Box("Alpha:", <<set width(120)), 
	Number Edit Box(1, <<set function(_expr))
)));
nw = New Window("",
	ob1 = Outline Box("Type in your own parameter values",
		
	),
	Button Box("Press Me", lub_expr)
);

Using Table Box with Col boxes could result in cleaner UI

-Jarmo

Re: add another layer of Edit boxes Button

An alternative approach would use a Table Box with Number Col Edit Box and String Col Edit Box elements. You can easily add a row to a table box.

Recommended Articles