cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-724000%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EJSL%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EC%B0%BD%EC%97%90%EC%84%9C%20%ED%83%AD%EC%9D%84%20%EC%84%A0%ED%83%9D%ED%95%98%EC%84%B8%EC%9A%94%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-724000%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94%20%EC%97%AC%EB%9F%AC%EB%B6%84%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%EC%A0%80%EB%8A%94%20JSL%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EC%97%AC%EB%9F%AC%20%EA%B0%9C%EC%9D%98%20%ED%83%AD%EC%9D%B4%20%EC%9E%88%EB%8A%94%20%EC%B0%BD%EC%9D%84%20%EB%A7%8C%EB%93%A4%EA%B3%A0%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80%20%EC%BD%A4%EB%B3%B4%20%EC%83%81%EC%9E%90(%ED%83%AD%20%EC%9D%B4%EB%A6%84%EC%9D%B4%20%EC%9E%88%EB%8A%94%20%EC%83%81%EC%9E%90)%EC%97%90%EC%84%9C%20%EC%84%A0%ED%83%9D%ED%95%98%EA%B3%A0%20%EC%84%A0%ED%83%9D%EC%97%90%20%EB%94%B0%EB%9D%BC%20%EB%A7%88%EC%B9%98%20%ED%83%AD%EC%9D%84%20%ED%81%B4%EB%A6%AD%ED%95%9C%20%EA%B2%83%EC%B2%98%EB%9F%BC%20%ED%95%B4%EB%8B%B9%20%ED%83%AD%EC%9D%B4%20%EC%95%9E%EC%9C%BC%EB%A1%9C%20%EB%82%98%EC%98%A4%EA%B2%8C%20%ED%95%98%EA%B3%A0%20%EC%8B%B6%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%EC%95%84%EB%9E%98%EC%97%90%20%ED%91%9C%EC%8B%9C%EB%90%9C%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%8A%94%20%EC%A0%9C%20%EB%AC%B8%EC%A0%9C%EB%A5%BC%20%EB%B3%B4%EC%97%AC%EC%A3%BC%EA%B8%B0%20%EC%9C%84%ED%95%B4%20%EB%A7%8C%EB%93%A0%20%EC%98%88%EC%9D%BC%20%EB%BF%90%EC%9E%85%EB%8B%88%EB%8B%A4.%20%22%EC%B0%BD%EC%9D%84%20%EC%95%9E%EC%9C%BC%EB%A1%9C%20%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0%22%EC%99%80%20%22%EC%B0%BD%20%ED%91%9C%EC%8B%9C%22%EB%A5%BC%20%EB%AA%A8%EB%91%90%20%EC%82%AC%EC%9A%A9%ED%95%B4%20%EB%B3%B4%EC%95%98%EC%A7%80%EB%A7%8C%20%EB%91%98%20%EB%8B%A4%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%95%98%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%EC%A0%80%EB%8A%94%20JMP%2017.1%20%EB%B2%84%EC%A0%84%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EA%B3%A0%20%EC%9E%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enames%20default%20to%20here%20(1)%3B%0A%0Anw%20%3D%20new%20window(%22example%22%2C%0A%09%26lt%3B%3CMODAL%3E%3C%2FMODAL%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%20%3C%2FCODE%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%3CLINGO-LABS%20id%3D%22lingo-labs-724000%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%EC%9E%90%EB%8F%99%ED%99%94%20%EB%B0%8F%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FCODE%3E%3CLINGO-SUB%20id%3D%22lingo-sub-724031%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20JSL%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EC%B0%BD%EC%97%90%EC%84%9C%20%ED%83%AD%20%EC%84%A0%ED%83%9D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-724031%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4368%22%20target%3D%22_blank%22%3E%40tbidwell%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%26lt%3B%26lt%3B%20set%20selected(%20n%20)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%EC%9D%B4%EB%A0%87%EA%B2%8C%20%ED%95%98%EB%A9%B4%20%EC%99%BC%EC%AA%BD%EC%97%90%EC%84%9C%20%EC%98%A4%EB%A5%B8%EC%AA%BD%EC%9C%BC%EB%A1%9C%20n%EB%B2%88%EC%A7%B8%20%ED%83%AD%EC%9D%B4%20%ED%99%9C%EC%84%B1%ED%99%94%EB%90%A9%EB%8B%88%EB%8B%A4.%20%ED%83%AD%20%EC%83%81%EC%9E%90%EC%97%90%20%EB%B3%80%EC%88%98%20%EC%9D%B4%EB%A6%84%EC%9D%84%20%EC%A7%80%EC%A0%95%ED%95%98%EB%A9%B4%20%EC%9E%91%EB%8F%99%ED%95%A0%20%EA%B2%83%EC%9E%85%EB%8B%88%EB%8B%A4.%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Etb%20%3D%20tab%20box(%0A%09%09%09tab%20page%20box(%22Selection%22%2C%0A%09%09%09%09v%20list%20box(%0A%09%09%09%09%09Text%20box(%22Choose%20your%20tab%3A%22)%2C%0A%09%09%09%09%09cb.tab%20%3D%20combo%20box(%7B%22Click%20to%20choose%3A%22%2C%20%22Tab1%22%2C%20%22Tab2%22%7D%2C%0A%09%09%09%09%09%09tab_selection%20%3D%20cb.tab%20%26lt%3B%26lt%3B%20get%20selected()%3B%0A%09%09%09%09%09%09if(%20tab_selection%20%3D%3D%20%22Tab1%22%2C%0A%09%09%09%09%09%09%09%09%2F%2Ftpb.tab1%20%26lt%3B%26lt%3B%20bring%20window%20to%20front%3B%0A%09%09%09%09%09%09%09%09tb%20%26lt%3B%26lt%3B%20set%20selected%20(%202%20)%3B%0A%09%09%09%09%09%09%09%2C%0A%09%09%09%09%09%09%09tab_selection%20%3D%3D%20%22Tab2%22%2C%0A%09%09%09%09%09%09%09%09%2F%2Ftpb.tab2%20%26lt%3B%26lt%3B%20show%20window%3B%0A%09%09%09%09%09%09%09%09tb%20%26lt%3B%26lt%3B%20set%20selected(%203%20)%0A%09%09%09%09%09%09)%3B%0A%09%09%09%09%09)%2C%0A%09%09%09%09)%2C%0A%09%09%09)%2C%0A%09%09%09tpb.tab1%20%3D%20tab%20page%20box(%22Tab1%22)%2C%0A%09%09%09tpb.tab2%20%3D%20tab%20page%20box(%22Tab2%22)%2C%0A%09%09)%2C%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
tbidwell
Level III

Use JSL to select a tab in a window

Hi all,

 

I am using JSL to create a window with multiple tabs in it.  I'd like to have the user select from the combo box (that has the tab names in it) and based upon the selection make that tab come to the front, as if they had clicked on the tab.  The script I've shown below is just an example I made up to demonstrate my issue. I've tried using both "bring window to front" and "show window" but neither work.

 

I am using JMP version 17.1.

 

names default to here (1);

nw = new window("example",
	<<modal,
	v list box(
		tab box(
			tab page box("Selection",
				v list box(
					Text box("Choose your tab:"),
					cb.tab = combo box({"Click to choose:", "Tab1", "Tab2"},
						tab_selection = cb.tab << get selected();
						if( tab_selection == "Tab1",
								tpb.tab1 << bring window to front;
							,
							tab_selection == "Tab2",
								tpb.tab2 << show window;
						);
					),
				),
			),
			tpb.tab1 = tab page box("Tab1"),
			tpb.tab2 = tab page box("Tab2"),
		),
		h list box(
			button box("OK"),
			bbc = button box("Cancel"),
		),
	),
);

if(nw == {Button(-1)}, stop() );

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Use JSL to select a tab in a window

Hi @tbidwell 

 

<< set selected( n )

This will activate the nth tab from left to right. Assign a variable name to the tab box and this should work.

 

tb = tab box(
			tab page box("Selection",
				v list box(
					Text box("Choose your tab:"),
					cb.tab = combo box({"Click to choose:", "Tab1", "Tab2"},
						tab_selection = cb.tab << get selected();
						if( tab_selection == "Tab1",
								//tpb.tab1 << bring window to front;
								tb << set selected ( 2 );
							,
							tab_selection == "Tab2",
								//tpb.tab2 << show window;
								tb << set selected( 3 )
						);
					),
				),
			),
			tpb.tab1 = tab page box("Tab1"),
			tpb.tab2 = tab page box("Tab2"),
		),

 

-Scott

View solution in original post

1 REPLY 1

Re: Use JSL to select a tab in a window

Hi @tbidwell 

 

<< set selected( n )

This will activate the nth tab from left to right. Assign a variable name to the tab box and this should work.

 

tb = tab box(
			tab page box("Selection",
				v list box(
					Text box("Choose your tab:"),
					cb.tab = combo box({"Click to choose:", "Tab1", "Tab2"},
						tab_selection = cb.tab << get selected();
						if( tab_selection == "Tab1",
								//tpb.tab1 << bring window to front;
								tb << set selected ( 2 );
							,
							tab_selection == "Tab2",
								//tpb.tab2 << show window;
								tb << set selected( 3 )
						);
					),
				),
			),
			tpb.tab1 = tab page box("Tab1"),
			tpb.tab2 = tab page box("Tab2"),
		),

 

-Scott