Announcement

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

    Removing duplicates from SelectItems

    We have a datasource bound to a dynamicform which has multiple SelectItems that we wanted to use as a filter. Some of the SelectItems have duplicate records that I wanted to avoid. Can anyone show me how this can be done or direct me to a sample code somewhere?
    Thanks,
    D

    #2
    I do this by manually setting the valueMap

    Code:
     selectItem.setValueMap(valueMap)
    I create the valuemap by
    Code:
      DSCallback callback = new DSCallback() {
    			@Override
    			public void execute(DSResponse response, Object rawData,
    					DSRequest request) {
    			  valueMap = response.getRecordList().getValueMap(NAME,NAME);
     }
     dataSource.fetchData(null,callback);
    This removes duplicates.

    I also have some listener code that I use to maintain these maps in case the data changes.

    Comment

    Working...
    X