Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 133548 - [DataBinding] field update not working when hitting <ENTER> toactivate default button
Summary: [DataBinding] field update not working when hitting <ENTER> toactivate defaul...
Status: RESOLVED DUPLICATE of bug 256543
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 133978 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-28 10:16 EST by Boris Bokowski CLA
Modified: 2009-03-13 01:04 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2006-03-28 10:16:23 EST
from the newsgroup:

Hi,

I created a simple login dialog, which has a default button called
login. When I click this button with the mouse, all values (userId and
password text field) are propagated through the databinding setup.
However, when I just hit the <ENTER> key to activate the default (login)
button, the last field I edited (typically the "password" field) is not
propagated to the property defined.

As a workaround, I programmatically set the focus to a different field
to trigger "onFocusLost", and then go on -> works nicely.

I tried to fill in a bug report, but I first have to register there, and
wanted to make this known as soon as possible, as it is probably a quick
fix.

Best Regards,

Christoph Jäger
Comment 1 Dave Orme CLA 2006-03-29 22:45:46 EST
*** Bug 133978 has been marked as a duplicate of this bug. ***
Comment 2 Al B CLA 2008-11-11 02:46:07 EST
Hi Boris, any plans to implement/fix this anytime soon?
Comment 3 Boris Bokowski CLA 2008-11-11 08:51:31 EST
Would you be able to attach a snippet that demonstrates the bug?
Comment 4 Boris Bokowski CLA 2009-01-24 23:46:37 EST

*** This bug has been marked as a duplicate of bug 256543 ***
Comment 5 Matthew Hall CLA 2009-01-25 00:44:39 EST
Note a dupe.  Bug 256543 is an enhancement to support SWT.DefaultSelection as the trigger for committing changes in the text field to the observable.

This bug is about when a Text field is being observed with the SWT.FocusOut event.  If the shell has a default button, and the user makes changes into a field and hits enter without leaving the field, then the default button is activated *without* the text observable having a chance to update.  Thus hitting enter before the last changes are committed can cause those changes to be lost.
Comment 6 Matthew Hall CLA 2009-03-13 01:04:25 EDT
I think I've changed my mind on this one.  There are two solutions available now: add SWT.DefaultSelection to the event type array when creating the observable for the text field; or disable the default button while the text field observable is stale.

*** This bug has been marked as a duplicate of bug 256543 ***