cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
frankeberle
Level II

Report Window Doesn't Close

I have a script that I am trying to set up that when run, it pops up an interactive GUI that looks like this:

Capture.JPG

I can populate the lot number and the only button that works at the moment is the "CPL Screen" one.  I click it and it produces a report of whether the wafers in that lot passed screening limits.  If there are error codes or super high values within the data a button box is added to the report asking if the user wants to have those values removed and the screening done again.

Capture1.JPG

I have set up the button to where it is supposed to close the current report window and data table associated with it and rerun the same "CPL Screen" as done in the beginning after removing the bad data.  The only problem is that when I click the rerun button the original window doesn close and the report doesn't finish. 

I can physically go into the script and highlight the code that is connected to the button and the script runs fine.  It only doens't work if I actually click the button.  Here is what the Window list looks like the when it is the first time through:

Capture2.JPG

Here is what it looks like when i click the rerun button:

Capture3.JPG

It seems that the original report doesn't close prior to the new one opening.  I am stumped considering I can phyically run the same code and everything works.  The following is a suedo flow chart of what the script is doing:

Capture4.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Any help would be much appreciated

2 ACCEPTED SOLUTIONS

Accepted Solutions
frankeberle
Level II

Re: Report Window Doesn't Close

I figured out that if you put a button in the report window that closes that window and continues with more script, the window that contained the button doesn't fully close. But if you place a button outside the report window that does the exact same script, then everything works fine. I am not exactly sure why that is and I had to change my script a little to compensate, but it now works fine in the end.

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: Report Window Doesn't Close

The button and all of its properties, including its script, is a child of a display tree. The display tree is contained in the window. When you close the window, the button and its script are destroyed. This would cause an error – potentially a very serious one – if it's the button script that closed the window. So, JMP watches for that and makes sure that the window is hiddent but hangs around for the button script to finish.

 

Here's a script to demonstrate this behavior. Watch the window list in your Home Window to see it:

win1 = New Window( "Window 1",
	V List Box(
		Button Box( "Close window 1 and open window 2",
			win1 << close window;
			win2 = New Window( "Window 2",
				<<Modal,
				V List Box( Text Box( "Click Ok to close me" ) )
			);
			win3 = New Window( "Now I'm really done",
				V List Box(
					Text Box( "Now I'm really done" ),
					Button Box( "Close Window 3", win3 << close window )
				)
			);
		)
	)
);

 

-Jeff

View solution in original post

5 REPLIES 5
frankeberle
Level II

Re: Report Window Doesn't Close

After more fiddling, it appears that the script isn't running in the sequence I had thought it should. I thought the script would execute things sequentially, as in line 10 would be executed then move on to line 11 and execute that. I found that even though I have the line of report << close window() on a line at the beginning of the rerun portion, the script doesn't fully execute that line until the script is fully finished. The window will become hidden but not fully closed until the new window is opened. Since I have a <<onclose() additive to the report window to close the data table that makes the histogram the rerun report gets the histogram initially but then the first report fully closes and it closes the data table for the histogram, removing the histogram from the second report.
Any ideas as to why JMP is doing this and what I can do to mitigate it? I forgot to mention that I am running JMP 12.
txnelson
Super User

Re: Report Window Doesn't Close

Popping open a window in JMP does not automatically stop the processing of your script.  One either has to declare the window to be a "Modal" window or embed the code to be run into the objects within the window, so they are not run until a user clicks on a button, or makes a choice in a combo box, etc.

So my guess, is that your JMP code continues processing while you have your window open, and you are thinking the processing is waiting your the user input prior to continuing.

Jim
frankeberle
Level II

Re: Report Window Doesn't Close

The code to add the button to the report window is thus:

if(errors_exist == 1 | large_value == 1,
error_box << append(Button box("Remove Erroneous Data and Rerun Analysis",redo_analysis))
)

The code for redo_analysis is as follows:

redo_analysis = expr(//if the user wants to eliminate error codes or large data values need to redo the screening and remove the issue points
close(dt_screen_results, nosave);
re_run = 1; //boolean flip to not have the script pull data from the database again
screen_result_window << close window;
//wait(5);
column(dt_lot, "Screen Results") << set selected(1);
dt_lot << delete columns();
if(errors_exist == 1, //deletes the error code rows
dt_lot << selectrows(error_rows)
);
if(large_value == 1,//deletes the large value rows
dt_lot << selectrows(large_values)
);
dt_lot << delete rows()
CPL_screen
//window(char(lot_num << get text) || " CPL Results Summary") << close window;
);

If I push the button in the report the issue persists. If i don't push the button but highlight redo_analysis in the script and run that portion everything works fine.

frankeberle
Level II

Re: Report Window Doesn't Close

I figured out that if you put a button in the report window that closes that window and continues with more script, the window that contained the button doesn't fully close. But if you place a button outside the report window that does the exact same script, then everything works fine. I am not exactly sure why that is and I had to change my script a little to compensate, but it now works fine in the end.
Jeff_Perkinson
Community Manager Community Manager

Re: Report Window Doesn't Close

The button and all of its properties, including its script, is a child of a display tree. The display tree is contained in the window. When you close the window, the button and its script are destroyed. This would cause an error – potentially a very serious one – if it's the button script that closed the window. So, JMP watches for that and makes sure that the window is hiddent but hangs around for the button script to finish.

 

Here's a script to demonstrate this behavior. Watch the window list in your Home Window to see it:

win1 = New Window( "Window 1",
	V List Box(
		Button Box( "Close window 1 and open window 2",
			win1 << close window;
			win2 = New Window( "Window 2",
				<<Modal,
				V List Box( Text Box( "Click Ok to close me" ) )
			);
			win3 = New Window( "Now I'm really done",
				V List Box(
					Text Box( "Now I'm really done" ),
					Button Box( "Close Window 3", win3 << close window )
				)
			);
		)
	)
);

 

-Jeff