Hi All,
I am referring to https://www.smartclient.com/smartgwt...endent_selects demo to create a dependent select listgrid.
This works fine for values using setEditorValueMapFunction. So if I change value in field A, the corresponding values gets populated in field B.
But my editor is selectitem with images in it. I tried setEditorValueIcons and setValueIcons but it works only for current loaded value. As soon as I change the value the icons never gets populated.
Do we have anything like setEditorValueIconFunction as well? I just want to update the dependent field's items with the images. So the valueicons of select item should also change. I am not able to find out. Kindly suggest.
Thanks in advance.
I am referring to https://www.smartclient.com/smartgwt...endent_selects demo to create a dependent select listgrid.
This works fine for values using setEditorValueMapFunction. So if I change value in field A, the corresponding values gets populated in field B.
But my editor is selectitem with images in it. I tried setEditorValueIcons and setValueIcons but it works only for current loaded value. As soon as I change the value the icons never gets populated.
Code:
field.setEditorValueMapFunction(new EditorValueMapFunction() { public Map getEditorValueMap(Map values, ListGridField field, ListGrid grid) { Map<String, String> valueMap = new HashMap<String, String>(); Map<String, String> iconMap = new HashMap<String, String>(); String myValue = "someVal"; switch(myValue){ case "A" : valueMap.put("1","B"); valueMap.put("2","C"); iconMap.put("1","B"); iconMap.put("2","C"); break; case "D": valueMap.put("5","E); iconMap.put("5","E"); break; default: valueMap.put("6","F"); iconMap.put("6","F"); } /* departmentSelectItem.setValueIcons(iconMap); field.setEditorValueIcons(iconMap);*/ Both of these are not working as expected return valueMap; } });
Thanks in advance.
Comment