Community
Participate
Working Groups
Build Identifier: Eclipse 20090920-1017 RAP 1.3.0.20100615-1704 While trying to set a new text to the Link widget using Link.setText(), an error occurs if the passed text has no anchor tag (<a>). In our environment, the anchor refrence is not used since we just interested in the event sent by the SelectionListener which is attached to the link. Note: Other platforms than PC/WinXP not tested. Reproducible: Always Steps to Reproduce: 1. Setup a Link widget with a SelectionListener. 2. Set a text surrounded by an anchor tag (<a> without any parameter). 3. During a request, set a text that isn't surrounded by an anchor tag (in order to have the link displayed not underlined) 4. The following error occurs and is displayed in the browser: Could not evaluate javascript response: TypeError: hyperlinks[this._currentFocusedLink] is undefined var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.findWidgetById( "w595" );w.dispose();var w = wm.findWidgetById( "w596" );w.dispose();var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "74" );var w = wm.findWidgetById( "w67" );w.setEnabled( false );var w = wm.findWidgetById( "w69" );w.clear();w.addText( "Fehlergruppen bearbeiten" );w.applyText();var w = wm.findWidgetById( "w198" );w.setVisibility( false );var w = wm.findWidgetById( "w199" );w.setVisibility( false );w.clear();w.addLink( "Fehler bearbeiten", 0 );w.applyText();var w = wm.findWidgetById( "w483" );w.setVisibility( true );var w = wm.findWidgetById( "w582" );w.setVisibility( false );var w = wm.findWidgetById( "w584" );w.setItemMetrics( 0, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 1, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 2, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 3, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 4, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 5, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 6, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 7, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 8, 0, 0, 0, 0, 0, 0 );w.setItemMetrics( 9, 0, 0, 0, 0, 0, 0 );w.updateRows();w.setItemCount( 0 );var w = wm.findWidgetById( "w610" );w.setSpace( 459, 6, 6, 20 );wm.setToolTip( w, "" );w.setLabel( "" );var w = wm.findWidgetById( "w2" );w.setActiveControl( wm.findWidgetById( "w542" ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w542" );org.eclipse.swt.FontSizeCalculation.measureStrings( [ [ 32479971, "Fehler löschen", [ "Tahoma" ], 12, false, false, -1 ] ] );
I wasn't able to reproduce this problem so far. Could you please add a snippet?
Created attachment 177707 [details] Snippet to reproduce I was able to reproduce this problem with the attached snippet. Steps to reproduce: 1. click on the link 2. click on the "restore" button 3. see this error message in the firebug console: hyperlinks[this._currentFocusedLink] is undefined in: hyperlinks[ this._currentFocusedLink ].blur();
Created attachment 177728 [details] Patch against RAP 1.3 Attached a patch that fixes the problem for RAP 1.3
Ralf, I think that resetting this._currentFocusedLink to -1 in Link.js#clear() is better. What do you think?
(In reply to comment #4) > Ralf, I think that resetting this._currentFocusedLink to -1 in Link.js#clear() > is better. What do you think? Good point. I agree that the focus index should be reset to -1 in clear(). But since I saw those range checks in _onKeyPress, i wanted to be on the safe side for the service release.
Created attachment 177746 [details] Updated patch against RAP 1.3 This patch resets the focus index to -1 in clear() as suggested in comment #4 AND adds range checks in _setFocusedLink()
Fixed in CVS HEAD. The problem was caused by the field _currentFocusedLink being out of range in Link.js, _setFocusedLink().
Applied last patch to maintenance 1.3 branch.