I am trying to set a SelectItem value using the display value. I want to do something like
SelectItem selectItem = new SelectItem();
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
valueMap.put("1", "a");
valueMap.put("2", "b");
valueMap.put("3", "c");
selectItem.setValueMap(valueMap);
then go
selectItem.setValueByDisplayValue("c");
Then when I use selectItem.getValue(), I want to see "3" returned (and not "c"). However, there is no method which does that.
My next thought was to get the value map back from the item, find the display value I want, get the value from it and set it that way, but for some reason there is no getValueMap() method on the Item class. That is, I want to do this (sometime after the above code)
LinkedHashMap<String, String> map = selectItem.getValueMap();
But this method doesn't exist! For goodness sake, why not?
Regards,
Jack
SmartGWT Version: 2.4
SelectItem selectItem = new SelectItem();
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
valueMap.put("1", "a");
valueMap.put("2", "b");
valueMap.put("3", "c");
selectItem.setValueMap(valueMap);
then go
selectItem.setValueByDisplayValue("c");
Then when I use selectItem.getValue(), I want to see "3" returned (and not "c"). However, there is no method which does that.
My next thought was to get the value map back from the item, find the display value I want, get the value from it and set it that way, but for some reason there is no getValueMap() method on the Item class. That is, I want to do this (sometime after the above code)
LinkedHashMap<String, String> map = selectItem.getValueMap();
But this method doesn't exist! For goodness sake, why not?
Regards,
Jack
SmartGWT Version: 2.4
Comment