In my web application, I need to fetch data from server to populate contents in a SelectItem. And I use SelectItem.setValueMap(LinkedHashMap), but there is always a random number added at the end of the contents. Below is my codes:
In constructor:
SelectItem selectItem = new SelectItem("category");
selectItem .setRequired(true);
selectItem .setTitle("Category");
selectItem .setMultiple(true);
selectItem .setMultipleAppearance(MultipleAppearance.GRID);
selectItem .setHeight(60);
Some where other thant constructor:
LinkedHashMap<String , String> map = new LinkedHashMap<String, String>();
// fetch data from server and pop up the map...
selectItem .setValueMap(map);
Could someone help me with that? Thanks a lot.
Sounds like you’re testing in Chrome development mode – can’t do this, because there’s a GWT/Chrome bug that will add extra data to every object, like you’re seeing.
Explained further, with references to the GWT and Chrome bugs for this, here:
http://forums.smartclient.com/showthread.php?t=8159#aChrome