Home Forums Presentation Forms Defaulting a Query Combo Box to a Non-Null Selection

Viewing 2 reply threads
  • Author
    • #10512
      Ryan HerbeckRyan Herbeck

      I have a query list form with a set of text fields and combo boxes for search criteria. I am looking to default a query combo box to a non-null selection when a user first views the query list or when the search criteria is cleared. Is there an existing configuration function that would allow the setup of this default behavior?

    • #10520

      Hi Ryan,

      From my experience there is no specific function/property to default the value for the combo.

      However you can achieve it by doing below:

      • For the initial load of the form/screen
        • In the script tab, create PostMessage function (which gets executed after the UI is rendered)
        • In the postMessage find your combo box and set the value
          • Using findViewpath , “value” is what you want to set
      • Above can be wrapped in a function which then can be called from a data action/ui action when “clearing” the search criteria.

      Hope that helps.


    • #10528

      The defaulting of combo is mostly achieved by setting the initializer of the attribute it’s bound to, but this only works in Add/Edit scenarios not search/query forms.

      Below is how you would set the default selection on a combobox

      (define defaultValue “test”) <– Not this will most probably be the enum object

      (define comboModel ((this’findView ‘(filterCombo))’collectionModel))
      (comboModel’currentIndex (comboModel’find defaultValue))

Viewing 2 reply threads
  • You must be logged in to reply to this topic.