Hi,
Also face this problem. But when put String into SelectItem seems to be working. Only when put in object the validation error occurs.
My bean code is as below:
public UIComponentBase getUserGroupsList(){
EntityManager em = getEntityManager();
listUserGroup = (List <UserGroup>) em.createQuery("select o from UserGroup as o").getResultList();
list=new UISelectMany();
System.out.println("sizeof list:"+listUserGroup.size());
SelectItem item = new SelectItem();
for(UserGroup x : listUserGroup) {
item = new SelectItem(x);
UISelectItem uiItem = new UISelectItem();
uiItem.setValue( item );
list.getChildren().add( uiItem );
}
return list;
}
The web page code :
<h:outputText value="User Group Assigned:"/>
<h:selectManyListbox binding="#{user.userGroupsList}">
[Message sent by forum member 'krashsun' (krashsun)]
http://forums.java.net/jive/thread.jspa?messageID=226522