| Summary: | Could not evaluate javascript response if open/close dialogs | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Steffen <steffen> | ||||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P2 | CC: | oliver, rsternberg, ruediger.herrmann | ||||||||
| Version: | 1.4 | ||||||||||
| Target Milestone: | 1.4 M7 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Steps to reproduce: 1. Click on button start in the TestQueue-dialog 2. Click ok or cancel in TestEditPre-dialog 3. Click or or cancel in TestEdit-dialog 4. Click ok or cancel in new TestEditPre-dialog 5. now you get the error message Please specify what version you are using. RWT 1.4M5 But i have also tested against M6 with the same issue. I can reproduce the error with your snippet and CVS HEAD. Steffen, I think that your code is not so correct. You dispose a shell ( call testEdit.close() ) in the DisposeEvent if the same Shell. Your code could be transformed into this:
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
shell.dispose();
new Dialog().open();
}
} );
Nevertheless, I will check how SWT handle disposing of a widget in widgetDisposed event of the same widget. Note, that in widgetDisposed event the widget.isDisposed() still returns false.
Created attachment 193085 [details]
Proposed patch.
This patch gets use of Widget RELEASE flag in the same way like in SWT. JUnit tests will follow.
*** Bug 233013 has been marked as a duplicate of this bug. *** Created attachment 193097 [details]
Updated patch with JUnit test
Applied patch to CVS HEAD. |
Created attachment 193010 [details] Package to reproduce the bug. If you open and close dialogs in a specific way, it can lead to a crash of a javascript response with the following error message: --- Could not evaluate javascript response: Error: TypeError: w is undefined Script: var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.findWidgetById( "w173" );w.doClose();wm.dispose( "w173" );var w = wm.findWidgetById( "w222" );w.doClose();wm.dispose( "w222" );wm.dispose( "w223" );wm.dispose( "w236" );wm.dispose( "w235" );wm.dispose( "w234" );wm.dispose( "w233" );wm.dispose( "w232" );wm.dispose( "w231" );wm.dispose( "w224" );wm.dispose( "w229" );wm.dispose( "w230" );wm.dispose( "w206" );wm.dispose( "w205" );wm.dispose( "w225" );wm.dispose( "w227" );wm.dispose( "w228" );wm.dispose( "w226" );var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "8" );var w = wm.findWidgetById( "w207" );w.setActive( true );org.eclipse.swt.WidgetManager.getInstance().focus( "w208" ); message: w is undefined stack: not relevant fileName: not relevant lineNumber: 56946 name: TypeError Debug: on Request: w222.activeControl=w205&org.eclipse.swt.events.widgetSelected=w205&w1.cursorLocation.x=709&w1.cursorLocation.y=396&w1.focusControl=w205&uiRoot=w1&requestCounter=7 --- To reproduce this you can find a source-package in the attachment named test. There you can find three files: 1. TestQueue.java 2. TestEdit.java 3. TestEditPre.java Short description of the source/use: First of all an instance of the TestQueue (dialog) will be created. It contains a button "start". By clicking on the button it will be repeatly create and open an instance of TestEdit (also a dialog) by calling method doTestEdit. The shell of TestEdit gets a dispose-listener. If the listener gets an event it trys to close the old TestEdit-dialog and open a new one by calling doTestEdit-method. The TestEdit-shell is not blocked on open. The open-method of TestEdit creates an instance of TestEditPre which will be instantly opened in the open-method of TestEdit. The shell of TestEditPre is blocked on open. By clicking ok or cancel in TestEditPre-dialog the dialog will be closed. By clicking ok or cancel in the TestEdit-dialog the dispose-listener gets an event and it creates/opens a new TestEdit-dialog by calling doTestEdit-method. Now, if you click ok or cancel in the new TestEditPre-dialog you get the error message above. Remark: If you remove the creation of TestEditPre-dialog you do not get any error messages so the problem seems to be at this position.