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

Bug 293867

Summary: Focussing doesn't work initially in Examples Demo
Product: [RT] RAP Reporter: RĂ¼diger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Qooxdoo framework patch
none
RWT patch none

Description RĂ¼diger Herrmann CLA 2009-11-01 07:06:11 EST
Steps to reproduce:
* Start the Examples Demo
* Click on the Button labeled "Add"
=> the "Cancel" button gains the focus instead

Clicking a second time on the "Add" button works as expected. However, switching the another example page and then back to the "Buttons" page shows the behavior again.
It seems not to be related to the theme. Starting the examples demo with the default theme still shows the described behavior.
Comment 1 Ivan Furnadjiev CLA 2009-11-01 09:04:13 EST
It seems that it is not related to the Button widget only. Reproducible with "Input widgets" too. Click on the "Last name" field move the focus to "First name" field.
Comment 2 Ivan Furnadjiev CLA 2009-11-02 13:47:58 EST
In case of a custom tab list (see WorkbenchPage#updateTabList(IWorkbenchPart)) the -1 is rendered for the control tabIndex property. But in qooxdoo tabIndex = -1 means that the widget can't handle focus at all (mouse and tab) - see Widget.js#isFocusable(). In this case mouse click on a widget (button for example) with tabIndex property set to -1 will lead to wrong focusedControl send by shell (shell is set as focused control instead of button). The solution is the following:
1. Remove check this.getTabIndex() >= 0 from Widget.js#isFocusable(), leave only the check for this.getTabIndex() != null.
2. In all places where the tabIndex is set to -1, set it to null to make the widget unfocusable (mouse and tab). Thus, setting tabIndex to -1 will make the widget focusable by mouse, but not by tab. Affected widgets:
 - qooxdoo Parent, Window, Spinner and ComboBox (not used by RWT).
 - all RWT widgets where tabIndex = -1 is used.
Comment 3 Ivan Furnadjiev CLA 2009-11-02 15:45:26 EST
Created attachment 151117 [details]
Qooxdoo framework patch
Comment 4 Ivan Furnadjiev CLA 2009-11-02 15:46:00 EST
Created attachment 151118 [details]
RWT patch
Comment 5 Ivan Furnadjiev CLA 2009-11-03 07:00:25 EST
Applied both patches to CVS HEAD. To make the qooxdoo widget completely unfocusable (mouse and tab) set the tabIndex to null. Setting tabIndex to -1 will exclude the widget from tab order, but widget will still be focusable by mouse.