Announcement

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

    Appending a value to all comboboxes

    Ok, here's the problem. We want a way for the user to deselect a combobox (i.e. to change from returning a value to returning null).


    This was a late addition to requirements as we have a huge number of comboboxes defined in many DB tables and I would REALLY like a better way than going into every single table and adding a null value to the list of combobox options. Frankly having an "empty" option on the combobox at all doesn't sound all that attractive but I can't think of any other way to return a combobox to a "null" state that your normal user could easily understand and use.

    Is there a way to alter the ResultSet so that on dataArrived I can just slip in a pair of empty objects? I'm already overriding dataArrived globally to do some checking so adding an object to the set there sounds fairly convenient but I'm not sure what the object structure should be in a combobox result set or if its read only.

    Can anyone give me some guidance on this?
    Thanks

    #2
    If these are ComboBoxes, why can't the user simply delete the typed-in value? In a SearchForm, that's treated as null criteria automatically.

    Comment


      #3
      Well we're using comboboxes because we like the "autocomplete feature" that lets users narrows down huge lists easily, but we're not allowing the user to actually enter anything that's not provided from the ResultSet to avoid them typing in nonsensical information. So in order for something to be a valid submission it must be contained in the original ResultSet. I can special case this to say that either a member of the resultset or " " is an acceptable submission, in fact that was my plan B, but I was worried that end users might not intuitively think of doing that so I wanted to add an "empty" item to the result set that they could select. Is there a way of doing this or should I just add the special case code?
      Thanks

      Comment


        #4
        It's a built-in feature of SelectItem (allowEmptyValue:true) but for ComboBoxes we regarded it as obvious that you can clear it by simply deleting what you typed.

        You can always have your server code return a special blank value from the optionDataSource but it doesn't seem worth it.

        Comment


          #5
          Deleting value in ComboBox (in ListGrid) doesn't work well with addUnknownValues: false. The value reverts to original value after confirming deletion with Enter. Moving to another record works as expected but it's not what I'd like to explain to users...

          Confirming with Enter works OK if addUnknownValues is set to true, but then, it allows any value to be confirmed...

          Comment

          Working...
          X