Announcement

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

    How to show unique values in the ComboBox dropd down list ?

    Hello,
    I am using SmartClientOperations.wsdl with Axis2 and hibernate on the server side.
    I have a lot of database fields which shoud be combobox'ed. Drop down values should be a list of already saved values in this field through all records.

    This is nicely handled by setOptionDataSouce(), but repeating values are on the list, too. In my case, I do not need to distinguish records with the same value in the field. I just need a distinct list of already entered values stored in the database (there are thousands of records, but only hundreds of unique field values).

    Could you suggest the right way to go ?

    I could do datasource.fetchData and fill LinkedHashMap using rowData adding unique only values, but this is a kind of "disconnected" from datasource once done, so newly entered and saved form values are not listed.

    Thanks,
    MichalG

    #2
    Probably best if you filter these to unique values on the server itself to that the data returned for the optionDataSource is already limited to unique values.

    Sanjiv

    Comment


      #3
      Since I need to create a distinict (by some field) record set on the client, I wonder what's the best way to accomplish this.

      Scenario:
      I introduced a text field groupName into several Datasources by which all records could be grouped. Now if the user decides to assign a record to a group, he needs to specify the group name. To ease that task, I'd like to use a ComboBoxItem displaying all group names already used.
      The default approach
      Code:
      TreeGridField group = new TreeGridField("groupName");
      group.setEditorType(new ComboBoxItem());
      comes short since the ComboBox will contain duplicates if more than two records are in one group.
      So I am looking for an appropriate entry point to eleminate duplicates myself but could not find one.
      Code:
      filterClientPickListData()
      and
      Code:
      getClientPickListData()
      do not seem to work for Datasource bound grids (at least, they are never invoked in my case).

      Any Ideas?
      Thanks
      fazopilot

      Comment

      Working...
      X