This is a common problem and I already saw the basic solution (populate the selectManyListBox
). Here is the code of my JSF 1.2 page:
<h:selectManyListbox id="statusMenu" converter="statusConverter" value="#{aprvAction.ap.statuses}" >
<f:selectItems id="statusItem" value="#{action.ap.statusItens}"/>
<a:support event="onclick" ajaxSingle="true" immediate="true" eventsQueue="queueGeral" />
<a:support event="onchange" ajaxSingle="true" eventsQueue="queueGeral" process="statusMenu"/>
</h:selectManyListbox>
The thing is that #{aprvAction.ap.statuses}
is an instance of List<Status>
class. However, in tag <f:selectItems>
the value: #{action.ap.statusItens}
is an Instance of List<SelectItem>
.
I populate the the #{aprvAction.ap.statuses}
with the values that I want to pre-select the ListBox, but did not work. I think it's because they are different objects in <selectManyListBox>
and <selectItems>
.
How can I solve this, and show the pre-selected values in <selectManyListBox>
?