I teaked it a bit to make it a SFSB and pull a list of objects. For anyone else that tries this do not put valueMethod="???" if you change the value stragety to valueStrategy = SelectItems.Strategy.OBJECT.
I thought for sure I needed this, but errors occur after you add the converter. It kept returning the label value to the converter and chocking in my public String getAsString(FacesContext ctx, UIComponent component, Object value) method since I am looking it up by the id in the converter. I haven't fully tested this out, but so far it really rocks. More people should post their stuff to the wiki like Jim did. All I need now is a way to have my entites convert themselves so I do not have to go to the trouble of making one for every type. Is anyone close to or have a solution for this? | @Name("selector") | @Stateful | @Scope(ScopeType.EVENT) | @Interceptors(SeamInterceptor.class) | public class SelectorAction implements Selector, Serializable | { | private static final long serialVersionUID = 1691282596699470676L; | | @Logger Log log; | @PersistenceContext EntityManager em; | | private Grade selected; | public Grade getSelected() { return selected; } | public void setSelected(Grade selected) { this.selected = selected; } | | @SelectItems(valueStrategy = SelectItems.Strategy.OBJECT, labelMethod = "getGrade) | public List items; | | @Factory("items") | public List getItems() | { | items = em.createQuery("from Grade").getResultList(); | return items; | } | | public void select() | { | log.info("You selected: " + selected.getGrade()); | } | | @Remove @Destroy | public void destroy() { } | } | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3954949#3954949 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3954949 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user