cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
kuannygoh
Level I

How to collapse a outline box in a tab page

Hi all , i am very new to jsl programming , want to ask  ,how can i collapse a outline box in a tab page  ?

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


win = New Window( "Tab Box",
	tb = Tab Box(
		Tab Page Box( // tab contents
			Title( "First Step" ),
			 OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex ))),
			 OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
		),
		Tab Page Box( // tab contents
			Title( "Second Step" ),
			 OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			 OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
			
		)
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to collapse a outline box in a tab page

You can either set pointers to the Outline Box()s and close them individually, or use XPath() and find all of them and operate on all Outline Box()s together....see below

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


win = New Window( "Tab Box",
	tb = Tab Box(
		Tab Page Box( // tab contents
			Title( "First Step" ),
			 ob1=OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex ))),
			 ob2=OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  ob3=OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
		),
		Tab Page Box( // tab contents
			Title( "Second Step" ),
			 ob4=OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			 ob5=OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  ob6=OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
			
		)
	)
);
ob1<<close;
ob2<<close;
ob3<<close;
ob4<<close;
ob5<<close;
ob6<<close;

// or
//(win << xpath( "//OutlineBox" )) << close;
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: How to collapse a outline box in a tab page

You can either set pointers to the Outline Box()s and close them individually, or use XPath() and find all of them and operate on all Outline Box()s together....see below

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );


win = New Window( "Tab Box",
	tb = Tab Box(
		Tab Page Box( // tab contents
			Title( "First Step" ),
			 ob1=OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex ))),
			 ob2=OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  ob3=OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
		),
		Tab Page Box( // tab contents
			Title( "Second Step" ),
			 ob4=OutlineBox( "Summary", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			 ob5=OutlineBox( "Pareto plot", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			  ob6=OutlineBox( "Control chart", dt <<Distribution( Column( :Height, :Weight ), By( :sex )) ),
			
			
		)
	)
);
ob1<<close;
ob2<<close;
ob3<<close;
ob4<<close;
ob5<<close;
ob6<<close;

// or
//(win << xpath( "//OutlineBox" )) << close;
Jim
jc510_2
Level III

Re: How to collapse a outline box in a tab page

Just found and used this solution this morning with a journal created in a script - still works great!

Wanted to add that (at least in the journal context) using the XPath approach above also closes all children outline boxes - i.e., it acts like "Close All Below" instead of just "Close".

I had to add the line below to subsequently "silently" open associated children outline boxes, so that the parent outline boxes are all initially collapsed, but the children outline boxes are immediately visible when you toggle individual parent outline boxes.

(win << XPath( "//OutlineBox//OutlineBox" )) << Open All Below;

Re: How to collapse a outline box in a tab page

You can also use the in-line message:

 

Outline Box( "Summary",
	dt << Distribution( Column( :Height, :Weight ), By( :sex ) ),
	<<Close( 1 )
)