Announcement

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

    Question on setAddUnknownValues(true) ComboBoxItem

    Hi Isomorphic,

    is there an easy way in 5.0p to see if the new value of a addUnknownValues:true ComboBoxItem is actually new or selected from the dropdown?
    I have a usecase where I want to warn the user that certain functions are not expected to work when he or she enters an unknown value.

    Of course I can use addEditorExitHandler and query the Datasource for the entered value, but if the information is already available, I' like to it.

    Best regards
    Blama

    #2
    Querying the DataSource is the right approach. The ComboBoxItem currently doesn't expose this information, and it's asynchronously determined as well, so it would require multiple APIs to try to expose the ComboBoxItem's state here.

    Comment


      #3
      We don't have a dedicated API for this.

      A call to getSelectedRecord() would probably be the easiest way to get here - it'll return null if the user entered value doesn't match a record.
      It's not exactly perfect - a user could enter a value which does match a value from the dataSource and move on before the fetch has a chance to complete in which case getSelectedRecord() would also return null as the fetch is still in progress. Not sure if this'd be a concern in your application design or not.

      Comment

      Working...
      X