Issues with writeBean and globalKeyListeners

Hello,

Would greatly appreciate some help with the following scenario:

  • Simple form bound with a Binder.setBean(). (2 text fields) and a button to “submit”
  • ValueChangeMode is set to ON_CHANGE

In the following 2 cases the system works as expected

  • When a user enters the data and tabs out of one text field into another (values in the bound DSO get updated as soon as the user moves to another field and the original field loses focus)
  • When a user changes the data and actually clicks on the button (again, a focus change takes place and value in the DSO is updated)

However, if I register a key listener and press that shortcut key that I associate with the submit() function, the DSO does not get the updated value (I guess since no focus change even occurs in the browser). Moreover, even if I programmatically call binder.writeBean() in the submit() function, the value still does not update in the DSO.

Is there any programmatic way to “force” the value update from the UI to the bound DSO?

  • Some way to iterate through bound widgets and nudge each to sync?

Thanks a lot in advance for any insight!

Hi Tony

Setting the ValueChangeMode to EAGER is not an option?

Hi Kaspar,

  • EAGER mode is an option, but I felt that it is forcing unnecessary overhead, that I don’t otherwise need
  • writeBean() failure to commit the edit seems to be a bug and I would like to understand better why it behaves that way