Announcement

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

    Why is there no Item.getValueMap() method?

    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
    Last edited by incode; 26 Jul 2011, 23:39.

    #2
    Hi Incode,

    it seems to be an error that the API is missing.
    See http://forums.smartclient.com/showth...Map+SelectItem

    BR,
    Blama

    Comment

    Working...
    X