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

  | @Stateful
  | @Name("workgroupStudentManager")
  | @Scope(ScopeType.CONVERSATION)
  | @Conversational
  | public class WorkgroupStudentDetail implements 
WorkgroupStudentDetailInterface {
  |     @In
  |     private EntityManager entityManager;
  | 
  |     @In(required = false)
  |     @Out(required = false)
  |     private Collection<Person> workgroupAvailableStudents;
  |             
  |     private Collection<Person> workgroupSelectedStudents;
  |         // Getters and setters for workGroupSelectedStudents
  |     
  |     @Begin (join = true, flushMode = FlushModeType.MANUAL)
  |     @Factory("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
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to