I have a SelectItem object which has a few items. I set a value MAP with:

organizations[0] = "A";
organizations[0] = "B";
selectItem.setValueMap(organizations);

When displayed, the combo box is showing "A" as selected item. Then, I need to programatically select value "B" and select this on the current SelectItem object. I've been looking all over the place with no avail.

Anyone?

有帮助吗?

解决方案

If you want any option of selectItem to be manually selected, then you should try following:

selectItem.setValue("B");

After doing this when you open the picklist of the selectItem, value "B" will be highlighted.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top