0

I want to pre-charge a selectMultiMenu with values I already have in the application.

For example:

<b:panelGrid colSpans="2,2,8">
<h:outputLabel value="Traffic light color" />
<b:selectMultiMenu value="#{semaphoreBean.color}"  >
    <f:selectItems value="#{semaphoreBean.colors}" var="c" itemValue="#{c}" itemLabel="#{c}"/>
</b:selectMultiMenu>
</b:panelGrid>

if var color = "green, red" before than I load the page, I don't see in my selectMultiMenu 2 items selected. ¿What do I have to do to pre-load that field with those values?

Onefra
  • 11
  • 5

2 Answers2

0

Maybe that's because of the space between the entries. I take it you've take the example from our showcase. So I've added this line to our showcase, and it works like charm:

      private String color = "green,red";
Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37
0

Finally I found out data format was wrong so I fix it and works. Thank you for helping.

Onefra
  • 11
  • 5