cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lukasz
Level IV

How to display the last tab in the window by using the Tab Box?

Hello Everybody,

I have the following issue: I am creating a series of tabs within the Param_Overview window. Those tabs are generated in "for" loop. After the last tab, however, I would like to create one more tab created outside the for loop. The generation of tabs from the "for" loop works well but the addition of the last one does not. If I select by hand the code of the last tab and execute it, then the desired tab shows up in the windows as well. For creating the tabs in "for" loop the data table dt_run is used. For creating the last tab another table is used: zuv_data. How to activate the generation of the last tab? I would appreciate for hints and suggestions how to do that. I removed the content how each graph is created in order to simplify the code structure.

Best regards.

New Window( "Param_Overview", tb = Tab Box() );

For( iRun = 1, nitems(run_list), iRun++,
	tb << Add(		
		//todo		
		Lineup Box( N Col( 1 ),
			Outline Box( "Graph1",
				H List Box(
					dt_run << Graph Builder(
						// todo
						)
					),					
					dt_run << Graph Builder(
						// todo
						)
					)
				)
			),
			Outline Box( "Graph2",
				hlistbox = H List Box(
					dt_run << Graph Builder(
						// todo
						)
					),					
					dt_run << Tabulate(
						// todo
					)
				)
			)
		)
	)	
);
	
// the last tab
tb << Add("last tab",   //add one more tab
	Outline Box( "Last_Graph",
	H List Box(
	zuv_data << Graph Builder(
		// todo
		)
	)
	)
);
2 REPLIES 2
txnelson
Super User

Re: How to display the last tab in the window by using the Tab Box?

I filled out your example script, and corrected a couple syntax issues, and the code runs without error.  

Errors

  1. Your For() loop is an infinite loop.  Your code's ending element is never reached. 
    For( iRun = 1, nitems(run_list), iRun++,
    It needs to be
    For( iRun = 1, iRun <= nitems(run_list), iRun++,
     
  2. There was an issue with having matching ")" in the For Loop

Here is my rework of the code

Names Default To Here( 1 );
dt_run = open("$SAMPLE_DATA/big class.jmp");
zuv_data = open("$SAMPLE_DATAbig class families.jmp");

run_list = {a, b};

New Window( "Param_Overview", tb = Tab Box() );

For( iRun = 1, iRun <= N Items( run_list ), iRun++,
	tb << Add(		
		//todo		
		Lineup Box( N Col( 1 ),
			Outline Box( "Graph1",
				H List Box(
					dt_run << Graph Builder(
						Size( 528, 450 ),
						Show Control Panel( 0 ),
						Variables( X( :age ), Y( :height ) ),
						Elements( Points( X, Y, Legend( 3 ) ) )
					)
				),
				dt_run << Graph Builder(
					Size( 528, 450 ),
					Show Control Panel( 0 ),
					Variables( X( :age ), Y( :height ) ),
					Elements( Points( X, Y, Legend( 3 ) ) )
				)
			)
		),
		Outline Box( "Graph2",
			hlistbox = H List Box(
				dt_run << Graph Builder(
					Size( 528, 450 ),
					Show Control Panel( 0 ),
					Variables( X( :age ), Y( :height ) ),
					Elements( Points( X, Y, Legend( 3 ) ) )
				)
			),
			dt_run << Tabulate(
				Show Control Panel( 0 ),
				Add Table(
					Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
					Row Table( Grouping Columns( :age ) )
				)
			)
		)
	)
);
	
// the last tab
tb << Add(
	"last tab",   //add one more tab
	Outline Box( "Last_Graph",
		H List Box(
			zuv_data << Tabulate(
				Show Control Panel( 0 ),
				Add Table(
					Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
					Row Table( Grouping Columns( :age ) )
				)
			)
		)
	)
);
Jim
lukasz
Level IV

Re: How to display the last tab in the window by using the Tab Box?

Thank you!, it is working. I completely did not notice the error in For() loop. That is why it was not able to display the last tab. Best regards