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.
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.
Comment