  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: - selectManyListbox + convertEntity yields convers | Subject: - selectManyListbox + convertEntity yields convers 2007-10-01 - By Jeilong
Back When selecting two items from selectManyListbox I get the following validation error: anonymous wrote : Conversion Error setting value '7 9' for '# {workgroupSelectedStudents}'.
Evidently person with Id 7 and 9 were selected, but what is causing this validation error? I tried overriding equals() and to match objects on their @(protected) field. This yielded the same result. Can anyone shed some light on this? I am deploying this on Jboss 4.2.0.GA and Seam 2.0.0.GA.
addStudent.xhtml
| <s:validateAll> | <h:outputLabel for="studentlist" value="Pick students" /> | <h:selectManyListbox id="studentlist" size="14" required="true" value="# {workgroupSelectedStudents}"> | <s:selectItems value="#{workgroupAvailableStudents}" var="student" label="#{student.firstName} #{student.prefix} #{student.lastName}"/> | <s:convertEntity/> | </h:selectManyListbox> | </s:validateAll> |
WorkgroupStudentDetail.java
| @(protected) | @(protected)("workgroupStudentManager") | @(protected)(ScopeType.CONVERSATION) | @(protected) | public class WorkgroupStudentDetail implements WorkgroupStudentDetailInterface { | @(protected) | private EntityManager entityManager; | | @(protected)(required = false) | @(protected)(required = false) | private Collection<Person> workgroupAvailableStudents; | | @(protected)(required = false, scope = ScopeType.CONVERSATION) | private Collection<Person> workgroupSelectedStudents; | | @(protected) (join = true, flushMode = FlushModeType.MANUAL) | @(protected)("workgroupAvailableStudents") | public void findStudents() { | try { | workgroupAvailableStudents = (Collection<Person>) entityManager .createQuery("SELECT DISTINCT Object(per) FROM Person per").getResultList(); | } catch (Exception e) { | log.error("Exception occurred in findStudents() [WorkgroupStudentDetail] .", e); | } | } | | // .. | } |
Person.java
| @(protected) | @(protected)(name = "person") | public class Person implements Serializable { | | private static final long serialVersionUID = 7690407363935244693L; | private Long personId; | private School school; | private String firstName; | private String prefix; | private String lastName; | private Gender gender; | private Date dateOfBirth; | private String placeOfBirth; | private String mobile; | private String email; | private String nationality; | private String edexKey; | private String pgnoNumber; | private Date startDate; | private Date endDate; | private Boolean active; | private Boolean critical; | | @(protected) | public String toString() { | return getPersonId() == null ? null : getPersonId().toString(); | } | | @(protected) | @(protected)(strategy = GenerationType.IDENTITY) | @(protected)(name = "person_id") | public Long getPersonId() { | return personId; | } | | protected void setPersonId(Long personId) { | this.personId = personId; | } | // .. |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic &p=4090258#4090258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode =reply&p=4090258 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ jboss-user mailing list jboss-user@(protected) https://lists.jboss.org/mailman/listinfo/jboss-user
|
|
 |