Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with ChangedHandler on DataBound ComboBoxItem

    I have a ChangedHandler on a DataBound ComboBoxItem that makes use of the newly selected record to set up some other fields in the form. If I open up the pick list dropdown and make a selection that way everything works fine.

    However, if I type into the combobox and press Tab the ChangedHandler fires before the newly selected Record is returned from the server. My ChangedHandler code sees that ComboBoxItem.getSelectedRecord() returns null so it can't perform it's function yet.

    Do I need both a ChangedHandler and a DataArrivedHandler to do the same thing? Is there a better pattern to follow here?

    #2
    You should be able to just use the DataArrived handler and detect whether getSelectedRecord() is null.

    Comment


      #3
      Sorry, no, you will need both in order to cover the case that the user changes the selection among already loaded data. Just have them both call a common method and there will be no extra code.

      Comment

      Working...
      X