Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 308702 - Javascript error when programmatically selecting tab with ScrolledComposite
Summary: Javascript error when programmatically selecting tab with ScrolledComposite
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.3 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-09 16:24 EDT by Dave Lynott CLA
Modified: 2010-04-12 06:47 EDT (History)
0 users

See Also:


Attachments
Project used to reproduce bug (36.26 KB, application/octet-stream)
2010-04-09 16:26 EDT, Dave Lynott CLA
no flags Details
qooxdoo fix (3.36 KB, patch)
2010-04-12 06:34 EDT, Tim Buschtoens CLA
ivan: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Lynott CLA 2010-04-09 16:24:34 EDT
Build Identifier: RAP: 1.3.0-M6-20100316-1859

When programmatically selecting a TabItem with ScrolledComposite, the following Javascript error is displayed in the client's browser:

Could not evaluate javascript response:

org.eclipse.swt.custom.ScrolledComposite: Element must be created previously!

var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "12" );var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.findWidgetById( "w90" );w.setChecked( true );var w = wm.findWidgetById( "w92" );w.setChecked( false );var w = wm.findWidgetById( "w91" );w.setVisibility( true );var w = wm.findWidgetById( "w93" );w.setVisibility( false ); 

To demonstrate the problem, I've extended the mail demo so that upon double-clicking on a mail folder for a given account, an account view with tabs representing the various folders is displayed. The tab corresponding to the folder that was double-clicked in the navigation view is programmatically selected. The "Inbox" tab uses a ScrolledComposite whereas the other tabs do not.

Instructions in the "steps to reproduce" provide further explanation.





Reproducible: Always

Steps to Reproduce:
1. Within Navigator view, double-click on a non-Index folder to open an account view. Account view will open with tab corresponding to folder selected.
2. Double-click the Index folder within the Navigator view for that same account
3. Javascript error occurs

The error will not show if you select the Index tab within the new account view or if you double-click the Index tab when bringing up a new account view for the first time. The other tabs built with a simple Composite do not demonstrate this problem.
Comment 1 Dave Lynott CLA 2010-04-09 16:26:39 EDT
Created attachment 164429 [details]
Project used to reproduce bug

RAP mail template project extended to demonstrate problem.
Comment 2 Ivan Furnadjiev CLA 2010-04-12 05:16:25 EDT
Seems like "appear" event is fired even if widget is not created yet. Fixed in CVS HEAD.
Comment 3 Tim Buschtoens CLA 2010-04-12 06:34:15 EDT
Created attachment 164549 [details]
qooxdoo fix

This fixes qooxdoo itself, so the workaround is no longer needed. Needs to rebuild qx.js.

INFO:
In theory it is still possibly to fool qooxdoo into firing a false "appear" event, but only if the creation of the dom-node is forced (we don't do that), or by reparenting (we don't do that either).
Comment 4 Ivan Furnadjiev CLA 2010-04-12 06:47:18 EDT
Applied patch to CVS HEAD.