  | 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: - Re: selectManyListbox + convertEntity yields con | Subject: - Re: selectManyListbox + convertEntity yields con 2007-10-01 - By pete.muir@(protected)
Back Use
addStudent.xhtml
| <s:validateAll> | <h:outputLabel for="studentlist" value="Pick students" /> | <h:selectManyListbox id="studentlist" size="14" required="true" value="# {workgroupStudentManager.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; | | private Collection<Person> workgroupSelectedStudents; | // Getters and setters for 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); | } | } | | // .. | } |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic &p=4090278#4090278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode =reply&p=4090278 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ jboss-user mailing list jboss-user@(protected) https://lists.jboss.org/mailman/listinfo/jboss-user
|
|
 |