Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 297969

Summary: [Shell] JavaScript error when creating a dialog in certain constellations
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: webmaster
Version: 1.3   
Target Milestone: 1.3 M5   
Hardware: All   
OS: All   
URL: http://www.eclipse.org/forums/index.php?t=msg&th=159463
Whiteboard:
Attachments:
Description Flags
First try to fix it.
none
DemoTableViewPart.java to reproduct the problem
none
New patch none

Description Ivan Furnadjiev CLA 2009-12-16 10:29:36 EST
Sometimes a javascript error appear when a dialog is created:
----
Could not evaluate javascript response:
TypeError: $0 is null
----
See the newsgroup post for more details - http://www.eclipse.org/forums/index.php?t=msg&th=159463.
Comment 1 Ivan Furnadjiev CLA 2009-12-16 10:31:20 EST
Created attachment 154570 [details]
First try to fix it.
Comment 2 Markus Krüger CLA 2009-12-16 11:35:24 EST
Nope, does not help.
Comment 3 Markus Krüger CLA 2009-12-16 11:36:36 EST
Another Error that might have the same cause, but this time I could create it when launching from eclipse with debug:

000914 DEBUG: qx.core.Init[4]: qooxdoo 0.7.4 (r16878) [debug]
000953 DEBUG: qx.core.Init[4]: loaded 240 classes
000954 DEBUG: qx.core.Init[4]: loaded 3 interfaces
000955 DEBUG: qx.core.Init[4]: loaded 8 mixins
000956 DEBUG: qx.core.Init[4]: loaded 16 themes
000957 DEBUG: qx.core.Init[4]: loaded 0 locales
000957 DEBUG: qx.core.Init[4]: client: gecko-1.9/win/de
000958 DEBUG: qx.core.Init[4]: browser: firefox/none
000959 DEBUG: qx.core.Init[4]: application: org.eclipse.swt.Application[42]
000960 INFO:  qx.core.Init[4]: main runtime: 25ms
000960 DEBUG: org.eclipse.swt.Application[42]: preloading visible images...
000961 INFO:  org.eclipse.swt.Application[42]: render runtime: 2ms
000962 DEBUG: org.eclipse.swt.Request[37]: sending request [ w4t_survey=true; w4t_scriptEnabled=true; w4t_ajaxEnabled=true; startup=default; w4t_width=1680; w4t_height=865; w1.bounds.width=1680; w1.bounds.height=865; w1.scrollbar.size=16; w1.cursorLocation.x=0; w1.cursorLocation.y=0; uiRoot=w1; ]
000963 DEBUG: org.eclipse.swt.Application[42]: preloading hidden images...
003876 DEBUG: qx.ui.tree.Tree[680]: Ignoring invisible child: [object qx.ui.tree.Tree]
003906 DEBUG: qx.ui.tree.Tree[751]: Ignoring invisible child: [object qx.ui.tree.Tree]
004939 DEBUG: org.eclipse.swt.Request[37]: sending request [ 1062028231=485,13; 145910=16,13; 2849753=40,13; 13631582=27,13; 29897556=23,13; 10616280=7,13; 18916492=28,13; 1240618=31,13; 13766827=34,13; 21256008=6,13; 29244338=7,13; 4271947=68,13; 25692930=38,13; 9105584=35,13; 29354882=32,13; 16701175=24,13; 13834654=34,13; w1.cursorLocation.x=0; w1.cursorLocation.y=0; w1.focusControl=w216; uiRoot=w1; requestCounter=0; ]
005755 DEBUG: org.eclipse.swt.Request[37]: sending request [ w1.cursorLocation.x=0; w1.cursorLocation.y=0; w1.focusControl=w296; uiRoot=w1; requestCounter=1; ]
007603 DEBUG: org.eclipse.swt.Request[37]: sending request [ w290.activeControl=w296; org.eclipse.swt.events.widgetSelected=w296; w1.cursorLocation.x=552; w1.cursorLocation.y=346; w1.focusControl=w296; uiRoot=w1; requestCounter=2; ]
007828 DEBUG: org.eclipse.swt.Request[37]: sending request [ w1.cursorLocation.x=552; w1.cursorLocation.y=347; w1.focusControl=w216; uiRoot=w1; requestCounter=3; ]
007917 DEBUG: org.eclipse.swt.Request[37]: sending request [ w1.cursorLocation.x=552; w1.cursorLocation.y=347; w1.focusControl=w216; uiRoot=w1; requestCounter=4; ]
014334 DEBUG: org.eclipse.swt.Request[37]: sending request [ org.eclipse.swt.events.controlActivated=w101; w1.cursorLocation.x=316; w1.cursorLocation.y=447; w1.focusControl=w101; uiRoot=w1; requestCounter=5; ]
014581 DEBUG: org.eclipse.swt.Request[37]: sending request [ org.eclipse.swt.events.widgetSelected=w101; w1.cursorLocation.x=316; w1.cursorLocation.y=447; w1.focusControl=w101; uiRoot=w1; requestCounter=6; ]
014657 DEBUG: org.eclipse.swt.Request[37]: sending request [ org.eclipse.swt.events.widgetSelected=w101; w1.cursorLocation.x=316; w1.cursorLocation.y=447; w1.focusControl=w101; uiRoot=w1; requestCounter=7; ]
015567 DEBUG: org.eclipse.swt.Request[37]: sending request [ w1.cursorLocation.x=295; w1.cursorLocation.y=447; w1.focusControl=w312; uiRoot=w1; org.eclipse.swt.events.widgetSelected=w101; 166874=119,13; 19636089=50,13; 15915821=45,13; 1286998=418,13; 21536419=151,13; 10943145=18,13; requestCounter=8; ]
016694 DEBUG: org.eclipse.swt.Request[37]: sending request [ w1.cursorLocation.x=301; w1.cursorLocation.y=446; w1.focusControl=w312; uiRoot=w1; requestCounter=9; ]
016836 ERROR: org.eclipse.swt.Request[37]: Could not execute javascript: [var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.findWidgetById( "w298" );w.doClose();wm.dispose( "w298" );wm.dispose( "w307" );wm.dispose( "w310" );wm.dispose( "w309" );wm.dispose( "w308" );wm.dispose( "w306" );wm.dispose( "w305" );wm.dispose( "w304" );wm.dispose( "w301" );wm.dispose( "w303" );wm.dispose( "w302" );wm.dispose( "w300" );wm.dispose( "w299" );var w = wm.findWidgetById( "w311" );w.doClose();wm.dispose( "w311" );wm.dispose( "w320" );wm.dispose( "w323" );wm.dispose( "w322" );wm.dispose( "w321" );wm.dispose( "w319" );wm.dispose( "w318" );wm.dispose( "w317" );wm.dispose( "w314" );wm.dispose( "w316" );wm.dispose( "w315" );wm.dispose( "w313" );wm.dispose( "w312" );var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "10" );var w = wm.findWidgetById( "w24" );w.setActive( true );var w = wm.findWidgetById( "w101" );w.setTabIndex( -1 );var w = wm.findWidgetById( "w102" );w.setTabIndex( -1 );var w = wm.findWidgetById( "w216" );w.setTabIndex( 38 );var w = wm.findWidgetById( "w232" );w.setTabIndex( 27 );w.setSelectionForeground( "#ffffff" );w.setSelectionBackground( "#316ac5" );var w = wm.findWidgetById( "w235" );w.setTabIndex( 28 );var w = wm.findWidgetById( "w239" );w.setTabIndex( 30 );var w = wm.findWidgetById( "w257" );w.setTabIndex( -1 );w.setSelectionForeground( "#000000" );w.setSelectionBackground( "#ffffff" );var w = wm.findWidgetById( "w260" );w.setTabIndex( -1 );var w = wm.findWidgetById( "w264" );w.setTabIndex( -1 );var w = wm.findWidgetById( "w286" );w.setTabIndex( 39 );var w = wm.findWidgetById( "w24" );w.setActiveControl( wm.findWidgetById( "w216" ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w216" );]: TypeError - vElement is null
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:4347
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:24448
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:2483
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:5066
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:4899
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:21289
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3250
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3237
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18744
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18905
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3250
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3237
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18143
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:1959
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18069
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3250
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3237
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:3216
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18413
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:1959
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:18311
 at http://127.0.0.1:8181/rap?custom_service_handler=org.eclipse.rwt.internal.service.JSLibraryServiceHandler&hash=H215553654:2986
Comment 4 Markus Krüger CLA 2009-12-16 12:01:58 EST
Created attachment 154574 [details]
DemoTableViewPart.java to reproduct the problem

This is a replacement of the DemoTableViewPart.java of the RAP demo for reproducing the problem.

Just put it into the demo source, then make a war-file and deploy it (we use tomcat).
The view contains a bit more complex table than the original one and a button above it.

Now, as the application was deployed open the view an keep clicking the button fast until the error occurs ( i hope it does :-) )
It should raise an "TypeError: $0 is null" Exception.

Hope this helps and again, this is just a brutal way to raise the error, our users are getting this somehow, too.
Comment 5 Ivan Furnadjiev CLA 2009-12-16 12:02:28 EST
Created attachment 154575 [details]
New patch
Comment 6 Ivan Furnadjiev CLA 2009-12-16 13:26:58 EST
DOM mouse down listener is now attached on create event to make sure that getElement() is not null. In destruct isCreated() is checked before remove the DOM mouse down listener. Fixed in CVS HEAD. Markus, please reopen if the bug persist.
Comment 7 Markus Krüger CLA 2009-12-17 05:41:04 EST
Seems to be solved. Good job, Ivan!