This is how I'm getting two lists syncing:
<h:outputText value="Assignees: "/>
<s:selectManyPicklist id="assignees" value="#{projectSaver.assignees}"
size="5">
<f:selectItems value="#{projectSaver.workerItems}"/>
</s:selectManyPicklist>
<t:message for="assignees"/>
private List<Integer> assignees;
private List<SelectItem> workerItems;
public Integer[] getAssignees() {
if (null == assignees) {
assignees = new ArrayList<Integer>();
//fill it...
}
return (Integer[]) assignees.toArray(new
Integer[assignees.size()]);
}
public List<SelectItem> getWorkerItems() {
if (null == workerItems) {
workerItems = new ArrayList<SelectItem>();
//fill it full of items that have an Integer for a value
}
return workerItems;
}
I think you can safely swap between Integer, String, Dog, etc... just as
long as the value types match.
--
View this message in context:
http://www.nabble.com/SelectManyPicklist+component+%2C+can%27t+set+selected+values-t1710201.html#a4643827
Sent from the MyFaces - Users forum at Nabble.com.