Subscribe Bookmark RSS Feed

Changing Tab based on table box row selection

David_Burnham

Super User

Joined:

Jul 13, 2011

I have a table box displayed within a tab box.  When I make a selection in the table box I would like to switch to a different tab.  However, it seems that when the event handler for the row selection finishes, it returns focus to the original tab.

Here is some illustrative code.  Once a row is selected in the table box I want to set the focus to the 2nd tab.  I've put  Wait(2) in the code to show the switch of focus does occur - but the focus switches back when the function finishes.

Names Default To Here( 1 );
New Window( "Mountains",
	tab = Tab Box(
		"Tab1",
			tb = Table Box(
				String Col Box( "Mountain",
					{"K2", "Delphi", "Kilimanjaro", "Grand Teton"}
				),
				Number Col Box( "Elevation (meters)",
					{8611, 681, 5895, 4199}
				),
				Plot Col Box( "", {8611, 681, 5895, 4199} )
			),
		"Tab2",
			txt = Text Box("")
	)
);
tb << Set Selectable Rows();
tb << set row change function(
	Function( {this},
		Wait(0.3); // wait just long enough to show the selection
		txt <<Set Text("Selection=" || Char(this << get selected rows) );
		tab << Set Selected(2);
		Wait(2); // tab gets selected ... but only for 2 seconds
	)
);
-Dave
1 ACCEPTED SOLUTION

Accepted Solutions
Justin_Chilton

Joined:

Aug 27, 2015

Solution

This sounds like the same issue that @pmroz had here. We expect this to be fixed in JMP 13.2.

Thanks,

 

Justin
2 REPLIES
Justin_Chilton

Joined:

Aug 27, 2015

Solution

This sounds like the same issue that @pmroz had here. We expect this to be fixed in JMP 13.2.

Thanks,

 

Justin
pmroz

Super User

Joined:

Jun 23, 2011

Note that Dan Schikore provided a workaround solution in that previous post.