cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Jackie_
Level VI

Display number of selected rows in the new window

Hi,

 

I want to display number of selected rows in the modal window. Highlighting rows in the graph builder plot and displaying number of selected rows in the text edit box. Are there any options?

Jacksmith12_0-1657505745459.png

 

Names Default To Here( 1 );

// Open Data Table
dt = Open( "$SAMPLE_DATA/Growth Measurements.jmp", invisible );



New window("", Modal,
tb = Textbox("Rows selected"), text editbox(""),

Vlistbox(
gb = dt << Graph Builder(
	Size( 522, 452 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Graph Spacing( 8 ),
	Variables( X( :Age ), Y( :Growth ),Group X( :Growth ), Overlay( :Subject ) ),
	Elements( Line( X, Y, Legend( 13 ) ) )
);));

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Display number of selected rows in the new window


// Open Data Table
dt = Open( "$SAMPLE_DATA/Growth Measurements.jmp", invisible );

f = Function( {a}, teb<<settext(char(nitems(dt<<getselectedrows)) ));
rs = dt << make row state handler( f );

New window("", Modal, <<onclose(rs=0;1),
tb = Textbox("Rows selected"),teb= text editbox(""),

Vlistbox(
gb = dt << Graph Builder(
	Size( 522, 452 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Graph Spacing( 8 ),
	Variables( X( :Age ), Y( :Growth ),Group X( :Growth ), Overlay( :Subject ) ),
	Elements( Line( X, Y, Legend( 13 ) ) )
);));

The onclose script clears the handler when the window is closed so it won't make log messages about the missing TextEditBox, AND it returns 1, which allows the window to close.

Craige

View solution in original post

3 REPLIES 3
Craige_Hales
Super User

Re: Display number of selected rows in the new window


// Open Data Table
dt = Open( "$SAMPLE_DATA/Growth Measurements.jmp", invisible );

f = Function( {a}, teb<<settext(char(nitems(dt<<getselectedrows)) ));
rs = dt << make row state handler( f );

New window("", Modal, <<onclose(rs=0;1),
tb = Textbox("Rows selected"),teb= text editbox(""),

Vlistbox(
gb = dt << Graph Builder(
	Size( 522, 452 ),
	Show Control Panel( 0 ),
	Legend Position( "Bottom" ),
	Graph Spacing( 8 ),
	Variables( X( :Age ), Y( :Growth ),Group X( :Growth ), Overlay( :Subject ) ),
	Elements( Line( X, Y, Legend( 13 ) ) )
);));

The onclose script clears the handler when the window is closed so it won't make log messages about the missing TextEditBox, AND it returns 1, which allows the window to close.

Craige

Re: Display number of selected rows in the new window

I just want to be sure that you are aware that the row state status is displayed automatically in the Rows panel at the lower left of the Data Table. It isn't clear to me that you want a custom status.

Jackie_
Level VI

Re: Display number of selected rows in the new window

Because I am creating a UI with modal window and the open data table in invisible to the user