cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
robot
Level VI

Get Selected Outline Box Values

 

I have a window with a hierarchy of outline boxes.  I would like the user to select some boxes, and then retrieve the hierarchy with JSL.  Is this possible?  I only have 1 layer in my example hierarchy.  Ideally, this will work for a many-layered hierarchy.

 

but ultimately I would like several layers.

 

I am using JMP 18.1.2.

 

Names Default To Here( 1 );

cary = Associative Array();
cary["state"] = "NC";
cary["population"] = 116234;
cary["weather"] = "cloudy";
cary["population"] += 10;
cary["weather"] = "sunny";
cary["high schools"] = {"Cary", "Green Hope", "Panther Creek"};

Print( cary );

add_outline = Function( {target, input},
	{Default Local},
	Try(
		If( Type( input ) == "Associative Array",
			For Each( {key, index}, input << Get Keys,
				target << Append( Outline Box( key ) );
				add_outline( target[key], input[key] );
			)
		,
			target << Append( Text Box( input ) )
		)
	,
		target << Append( Text Box( "null" ) )
	)
);

win = New Window( "Cary Window" );
add_outline( win, cary );

// User will select some values.

win << Get Selected; // How to get selected values?
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Get Selected Outline Box Values

Use XPath. First select some value(s)

jthi_0-1741674652617.png

Then use << Get XML

win << get xml

Find the selected element from log to see how you could access it

jthi_1-1741674694438.png

Then write an XPath query and use it with << XPath. This example might not be what you are looking for as it looks for all selected elements

win << XPath("//*[@selected = 'true']")
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Get Selected Outline Box Values

Use XPath. First select some value(s)

jthi_0-1741674652617.png

Then use << Get XML

win << get xml

Find the selected element from log to see how you could access it

jthi_1-1741674694438.png

Then write an XPath query and use it with << XPath. This example might not be what you are looking for as it looks for all selected elements

win << XPath("//*[@selected = 'true']")
-Jarmo

Recommended Articles