Announcement

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

    ComboBox and fetchMissingValues

    I have combobox with optionDataSource set and fetchMissingValues is set to true. I have another field where I want to show some column from record that is selected in combobox. This is not problem when user changes value as I can use changed handler and getSelectedRecord() method. But I was wondering if there is some handler which is fired when related record is fetched from the server so that I can use received record in case when combobox value is set from code? I thought that dataArrived handler can be used in this case but it seems to me that it is not fired in this case.

    #2
    I have the same type of problem. I have a ComboBoxItem defined with an option data source. The CBI has a guid for the value and the display field of "name". When the value is set initially on the CBI (to some guid), I see that a fetch is done to pull back the record for that datasource, thereby getting the name to be displayed. All good.

    However, I have a data arrived handler defined on that CBI as I need to populate some other fields with some data that comes back in the fetch mentioned above. Problem is my handler never gets called on that automatic fetch of the initial record.

    Am I doing something wrong or should I be trying to do this differently?

    Thanks.

    Comment


      #3
      You could detect this circumstance by installing a formatter - you should notice getSelectedRecord() become non-null whereas previously it would have returned null.

      You could also add a transformResponse to the optionDataSource.

      You can of course also do your own, independent fetch (at some performance cost).

      We can't make this fire the DataArrived event as that would break others' code that relies on this as a notification that the pickList data has loaded.

      Comment


        #4
        Isomorphic,

        Thanks for the various ways to handle it. Much appreciated!

        I like the formatter option and will give that a go and post back an update as well.

        Thanks!

        Comment

        Working...
        X