cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Djtjhin
Level IV

Live Update Tab Page Box for input/output GUI

Happy New year to the JMP Community, I guess I'll start the new year with my very own first post

 

I'm trying to create a new window with has two tabs: (1) Input, (2) Analysis. The idea is for users to key in the inputs in the number edit boxes within the "Input" Page which will create a table variable for future reference and subsequently update a similar number edit box in "Analysis" Page with the value that has just been updated. The intent of having "Analysis" tab is to let users choose the different analysis but without the pain of re-inserting the same input values (which can be a number of inputs). 

 

I've tried the script below but it couldn't really work. The number edit box under "Analysis1" page kept showing 0 and not being updated with the new value. 

Any inputs on how to solve this ?

names default to here(1);

dt = current data table();

nw = new window("Test",
	tb = tab box(
		Tab Page Box("Input",
			V List Box(
				Lineup box(N col(2),
					Text box("Diameter"),
					neb1 = number edit box()
				),
				Button box("Update",
					dt << set table variable ("Dia",neb1 << get);
					PB1 << inval;
					PB1 << updatewindow;
				)
			)
		),
		Tab Page Box("Analysis",
			Tab box(
				Tab Page Box("Analysis1",
					
					PB1 = Panel box("Analysis",
					v1 = dt << get table variable ("Dia");
					if(v1=="",v1 = 0,v1 = dt: Dia);
						V List Box(
						Lineup box(N col(2),
						Text box("Diameter"),
						neb2 = number edit box(v1)
					)
					)
					)
				),
				Tab Page Box("Analysis2")
			)
		)
	)
);

Input1.JPG

 

Analysis1.JPG

 

1 ACCEPTED SOLUTION

Accepted Solutions
ThuongLe
Level IV

Re: Live Update Tab Page Box for input/output GUI

I think you forgot to update Analysis tab in the Update button section

Names Default To Here( 1 );

dt = Current Data Table();

nw = New Window( "Test",
	tb = Tab Box(
		Tab Page Box(
			"Input",
			V List Box(
				Lineup Box( N Col( 2 ), Text Box( "Diameter" ), neb1 = Number Edit Box() ),
				Button Box( "Update",
					dt << set table variable( "Dia", neb1 << get );
					PB1 << inval;
					PB1 << updatewindow;
					neb2 << Set(neb1 << get);
				)
			)
		),
		Tab Page Box(
			"Analysis",
			Tab Box(
				Tab Page Box(
					"Analysis1", 
					
					PB1 = Panel Box( "Analysis",
						v1 = dt << get table variable( "Dia" );
						If( v1 == "",
							v1 = 0,
							v1 = dt:Dia
						);
						V List Box(
							Lineup Box( N Col( 2 ),
								Text Box( "Diameter" ),
								neb2 = Number Edit Box( v1 )
							)
						);
					)
				),
				Tab Page Box( "Analysis2" )
			)
		)
	)
);
Thuong Le

View solution in original post

4 REPLIES 4
ThuongLe
Level IV

Re: Live Update Tab Page Box for input/output GUI

I think you forgot to update Analysis tab in the Update button section

Names Default To Here( 1 );

dt = Current Data Table();

nw = New Window( "Test",
	tb = Tab Box(
		Tab Page Box(
			"Input",
			V List Box(
				Lineup Box( N Col( 2 ), Text Box( "Diameter" ), neb1 = Number Edit Box() ),
				Button Box( "Update",
					dt << set table variable( "Dia", neb1 << get );
					PB1 << inval;
					PB1 << updatewindow;
					neb2 << Set(neb1 << get);
				)
			)
		),
		Tab Page Box(
			"Analysis",
			Tab Box(
				Tab Page Box(
					"Analysis1", 
					
					PB1 = Panel Box( "Analysis",
						v1 = dt << get table variable( "Dia" );
						If( v1 == "",
							v1 = 0,
							v1 = dt:Dia
						);
						V List Box(
							Lineup Box( N Col( 2 ),
								Text Box( "Diameter" ),
								neb2 = Number Edit Box( v1 )
							)
						);
					)
				),
				Tab Page Box( "Analysis2" )
			)
		)
	)
);
Thuong Le
Djtjhin
Level IV

Re: Live Update Tab Page Box for input/output GUI

I've tried this but it still doesn't work. I'm not sure if you're thinking of a different approach.

names default to here(1);

dt = current data table();

nw = new window("Test",
	tb = tab box(
		Tab Page Box("Input",
			V List Box(
				Lineup box(N col(2),
					Text box("Diameter"),
					neb1 = number edit box()
				),
				Button box("Update",
					dt << set table variable ("Dia",neb1 << get);
					TB1 << inval;
					TB1 << updatewindow;
				)
			)
		),
		Tab Page Box("Analysis",
			TB1 = Tab box(
				Tab Page Box("Analysis1",
					
					Panel box("Analysis",
					v1 = dt << get table variable ("Dia");
					if(v1=="",v1 = 0,v1 = dt: Dia);
						V List Box(
						Lineup box(N col(2),
						Text box("Diameter"),
						neb2 = number edit box(v1)
					)
					)
					)
				),
				Tab Page Box("Analysis2")
			)
		)
	)
);
ThuongLe
Level IV

Re: Live Update Tab Page Box for input/output GUI

Hi,
I posted the fixed script in previous reply. Please try
Thuong Le
Djtjhin
Level IV

Re: Live Update Tab Page Box for input/output GUI

Fantastic, Thanks!