[jboss-user] [JBoss Seam] - Re: UPDATED: SelectItems (the one with the EntityConverter)

petemuir do-not-reply at jboss.com
Fri Nov 10 10:42:53 EST 2006


http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamSelectItemsNewDesign

I've redesigned SeamSelectItems such that rather than using the @SelectItems annotation you just outject.  The magic now occurs completely in ui:selectItems (which only works with Facelets I'm afraid).   @SelectItems is still there if you are tied to JSP.

e.g.

@Entity public class User {
  | 
  |    @Id Integer id;
  |    String name;
  |    
  |    //getters and setters
  | }
    

public class ActionBean {
  | 
  | ...
  | 
  | @Factory("users") 
  | public List<User> getUsers() {
  |   List<User> users = em.createQuery("select u from User").getResultsList();
  |    return users;
  | }

<h:selectOneMenu value="#{foo.user}">
  |    <si:selectItems value="#{users}" var="user" label="#{user.name} (#{user.id})" />
  | </h:selectOneMenu>

I much prefer this design - it seems much simpler to use to me.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984935#3984935

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984935



More information about the jboss-user mailing list