Announcement

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

    Requery Comboboxitem

    Hi,

    what is the correct way to requery / refresh a comboboxitem?

    I have a form which contains a comboboxitem and I now I have a case, where while I am editing a record, a user might want to hit a button to requery the list part of a comboboxitem, since new selectabeĺe values will appear in the list after the requery.

    But I have not found a way to do it. I tried these commands:
    * myComboBoxItem.fetchData(); // Does not do a fetch for the list.
    * myComboBoxItem.invalidateDisplayValueCache(); // Does not do a fetch for the list.

    I've even set myComboBoxItem.setCachePickListResults(false) but it does not help either.


    TIA
    Andre
    Last edited by SCAI_Andre; 30 Jan 2012, 10:10.

    #2
    My current approach is to recreate the underlying datasource and reset this datasource as the optionDatasource.

    My problem now is that if value of the field of the comboboxitem of the current record was not in the initial recordset returned by the optionDatasource, this value is not replaced by the displayValue from the optionDatasource as long as I do not open the combobox once. Then the records get retrieved from the db and the displayValue is replaced.

    Calling myComboBoxItem.fetchData does not help since it does not trigger the displayValue-replacement.

    Any ideas?

    TIA,
    Andre

    Comment


      #3
      Adding this did the trick:
      myComboBoxItem.setCachePickListResults(false);

      Comment


        #4
        Nope, sorry, doesn't work :(


        The requery only happens when I open the drop down list.

        As lang as I do not do this, the text field part only shows the database ID of my value to lookup in the combo box.

        How can I change the optionDatasource and have the comboboxitem requery immediately?

        Comment


          #5
          It sounds like client-side filtering is not possible at all for your ComboBox? If so, you can disable it via setPickListProperties() -> setDataProperties() -> useClientFiltering:false.

          Avoid this if you possibly can, it necessarily becomes quite chatty with server calls. Consider setting fetchDelay higher to reduce the number of calls.

          Comment

          Working...
          X