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

Bug 395134

Summary: Missing focusLost when keyboard-triggering default button
Product: [RT] RAP Reporter: Marco Missfeldt <marco.missfeldt>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
workaround for the missing default-button transfer none

Description Marco Missfeldt CLA 2012-11-27 03:38:15 EST
Created attachment 223998 [details]
workaround for the missing default-button transfer

I use RAP version 2.0.0-M3-20121112-1148. I have a view with some controls and a default button, set by setDefaultButton(Button).

In SWT, when I press ENTER to trigger the default button, the focus changes to the default button before it is triggered. In RWT the focus doesn't change.

This only affects keyboard triggering. When I use the mouse to trigger the default button, the focus change occurs.

A possible workaround that works for me is added as a code snippet in the attachment: If I check and transfer the focus in my Button-Listener, I am able to get the behaviour which is the standard in SWT.
Comment 1 Marco Missfeldt CLA 2012-11-29 03:59:33 EST
I learned from Tom that on SWT-Mac the focus can't move to buttons. Still I think RAP should transfer the focus on ENTER, because in RAP the buttons *are* focussable and it is also transfered if using a mouse click. Then this would be exactly the same behaviour as in SWT-Win32 (where buttons also are focussable).
Comment 2 Ivan Furnadjiev CLA 2013-02-08 05:49:09 EST
Fixed with commit f815522e7e76dbfcf5764af7c552cfa3f478eb34. Now the default button gain the focus when it's triggered by keyboard.