Community
Participate
Working Groups
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
*** Bug 133978 has been marked as a duplicate of this bug. ***
Hi Boris, any plans to implement/fix this anytime soon?
Would you be able to attach a snippet that demonstrates the bug?
*** This bug has been marked as a duplicate of bug 256543 ***
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.
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 ***