Announcement

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

    Multi select drop down value field is getting displayed on UI

    I am facing two problems with multi select dropdown.

    1) I have set id in my valuefield to be saved in to database and in display field I have set of codes which are to be displayed on UI. But when i select the multiple values from the dropdown then at the time of selection it show the codes but on exit it shows ids of the selected codes which is not correct. I want to display only the codes but when i want to save it to db i need Ids. Below is the code

    SelectItem AttrItem = new SelectItem();
    final DataSource materialAttrDataSource = DataSource.get(ClientConstants.MATERIAL_ATTR_DS);
    ListGridField printCodeField= new ListGridField(ClientConstants.MATERIAL_ATTR_DS_PRINT_CODE,ClientConstants.PRINT_CODE);
    ListGridField printDescriptionField= new ListGridField(ClientConstants.MATERIAL_ATTR_DS_PRINT_DESCRIPTION,ClientConstants.DESCRIPTION_GRID_LABEL);
    ListGridField materiaAttrIdField= new ListGridField("materialAttrId","matAttrId");
    materiaAttrIdField.setCanHide(true);
    printDescriptionField.setWidth("200");
    AttrItem.setOptionDataSource(materialAttrDataSource);
    AttrItem.setMultiple(true);

    Please help.


    2) If multiple comma separated codes are coming from the database it does not shows all those codes as selected in the multi select dropdown.

    #2
    You continue to post partial or useless code in most of your threads. Please revisit the FAQ and the Debugging overview to understand what you need to post. Your posts will continue to be ignored most of the time, until you begin to post enough information for people to actually help you.

    Regarding comma-separated values, see DataSourceField.multiple and multipleStorage.

    Comment

    Working...
    X