Choose Language Hide Translation Bar
Highlighted
dqr2
Level IV

Modal window - removing an unwanted "Help" button

Hi - I need to incorporate the Graph Builder into a larger dashboard inside a modal window - which is easy to do, but it seems that a "Help" button (providing a link to the "Graph Zones" page of the JMP website) is being automatically added to the bottom of the window. I don't want it there, but I can't work out how to prevent it from appearing.

 

The following little script illustrates the issue. In it, I create three windows in succession, with the second and third being modal windows (so the third one isn't created until the second one is closed). The first and second windows don't add a "Help" button, whereas the third one does:

 

// Open Big Class, and minimize it to get it out of the way;

Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() << minimize window( 1 );

tb = Text Box( "Hello World!" );

// Create an expression that produces a simple chart from Big Class;

gb = Expr(
	Graph Builder(
		Show Control Panel( 0 ),
		Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
		Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
	)
);

// Now produce three different types of window to show what happens;

New Window( "Ordinary Window with TextBox, Graph Builder and OK Button", V List Box( tb, gb, Button Box( "OK" ) ) );

New Window( "Modal Window with TextBox and OK Button", <<modal( 1 ), V List Box( tb, Button Box( "OK" ) ) );
	
New Window( "Modal Window with TextBox, Graph Builder & OK Button", <<modal( 1 ), V List Box( tb, gb, Button Box( "OK" ) ) );

 

Can anybody help? (I'm using JMP 14, in case this is relevant)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
gzmorgan0
Super User

Re: Modal window - removing an unwanted "Help" button

Cameron was on the right track. There must be hidden button boxes.  I added a caption to show how many. 

 

Try this.  BTW, I like to create the object in a display box then add it (see glb).  I added the OnOpen() script to the original script and attched it as a file.

 

// Open Big Class, and minimize it to get it out of the way;

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() << minimize window( 1 );

tb = Text Box( "Hello World!" );

// Create an expression that produces a simple chart from Big Class;

glb = V List Box(gb = dt << Graph Builder(
		Show Control Panel( 0 ),
		Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
		Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
	)
	
New Window( "Modal Window with TextBox, Graph Builder & OK Button", <<modal(1), 
<< On Open( _nw = Window("Modal Window with TextBox, Graph Builder & OK Button")<<child;
    _xx= _nw << Xpath("//ButtonBox");
    Caption(char(nitems(_xx)));
    wait(2);
    Caption(Remove);
    Try(_xx[5] << Visibility(Collapse))
 ),
 vlb = VListBox(tb, glb, ButtonBox("OK"))
 
 );

 

View solution in original post

3 REPLIES 3
Highlighted
cwillden
Super User

Re: Modal window - removing an unwanted "Help" button

Problem with modal windows is you can't run any additional JSL until the user does something.  I thought you might be able to navigate to the display tree and delete the button using << On Open() right after << modal.  However, it doesn't seem to like it.  I tried traditional display tree navigation first:

New Window( "Modal Window with TextBox, Graph Builder & OK Button", << modal, << On Open( Current Window()[Button Box(2)] << Delete), V List Box( tb, gb, Button Box( "OK" ) ) );

This returned an error about not being able to subscript Current Window(), which seems to return a reference to the HeadBox (can't find any documentation about methods on the headbox, not even sure what it is).

 

And then with xpath:

New Window( "Modal Window with TextBox, Graph Builder & OK Button", << modal, << On Open( (Current Window() << xpath("//ButtonBox[ text() = 'Help']")) << Delete), V List Box( tb, gb, Button Box( "OK" ) ) );

Both failed to do anything, and after the xpath, it returns a reference to the button box (pretty strange).

 

Can you get by without making the window modal?  I usually try to avoid them because they tend to be obnoxious (e.g. users can't figure out why they can't bring up another window because they haven't pressed OK or Cancel on a modal window somewhere).

 

-- Cameron Willden
Highlighted
gzmorgan0
Super User

Re: Modal window - removing an unwanted "Help" button

Cameron was on the right track. There must be hidden button boxes.  I added a caption to show how many. 

 

Try this.  BTW, I like to create the object in a display box then add it (see glb).  I added the OnOpen() script to the original script and attched it as a file.

 

// Open Big Class, and minimize it to get it out of the way;

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Current Data Table() << minimize window( 1 );

tb = Text Box( "Hello World!" );

// Create an expression that produces a simple chart from Big Class;

glb = V List Box(gb = dt << Graph Builder(
		Show Control Panel( 0 ),
		Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
		Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
	)
	
New Window( "Modal Window with TextBox, Graph Builder & OK Button", <<modal(1), 
<< On Open( _nw = Window("Modal Window with TextBox, Graph Builder & OK Button")<<child;
    _xx= _nw << Xpath("//ButtonBox");
    Caption(char(nitems(_xx)));
    wait(2);
    Caption(Remove);
    Try(_xx[5] << Visibility(Collapse))
 ),
 vlb = VListBox(tb, glb, ButtonBox("OK"))
 
 );

 

View solution in original post

Highlighted
dqr2
Level IV

Re: Modal window - removing an unwanted "Help" button

Hi both - that last example works perfectly, and is a really useful demo of several features (i.e. the << Child, Xpath and Visibility options) that I've not properly explored before. The use of a modal window is pretty much essential in this instance, as I really do need the user to supply some information at that point in my script before the analysis can proceed.

Just for the record, I assumed there ought to be an "<< on open()" option to correspond to "<< on close()", and subsequently located a reference to it in the JSL Syntax Reference PDF from the "Books" item on the Help menu, but I wasn't able to create one that seemed to do anything. I certainly wouldn't have been able to get there without this example.

Many thanks!

Article Labels

    There are no labels assigned to this post.