This content has been marked as final.
Show 5 replies
-
1. Re: Questions on s:selectItems
pmuir Mar 3, 2007 10:21 AM (in response to gus888)"gus888" wrote:
I used following code in converters class:return ((EntityManager) Component.getInstance("em")).find( Category.class, Integer.valueOf(arg2));
then I got the entityManager is null exception. However, after I change "em" to "entityManager", exception disappeared.
I find this very hard to believe. By entityManager is null you mean you get an NPE? Or are you trying to use the entityconverter with this?In addition, I ever read a posting which stated the s:selectItems currently doesn't support h:selectOneRadio. Is it correct? since I cannot get it work.
-
2. Re: Questions on s:selectItems
gus888 Mar 3, 2007 11:53 AM (in response to gus888)Hi Peter,
Thank you for your reply. Yes, when I use "em" as persistent name, I got an exception "entityManager is null". Then I changed "em" into "entityManager" in components.xml, and also changed the converter code to:return ((EntityManager)Component.getInstance("entityManager")).find(Category.class, Integer.valueOf(arg2));
then the exception disappeared.the s:selectItems currently doesn't support h:selectOneRadio.
Sorry I made a stupid mistake, s:selectItems works in h:selectOneRadio. Thank you very much. -
3. Re: Questions on s:selectItems
gus888 Mar 3, 2007 12:01 PM (in response to gus888)"petemuir" wrote:
Or are you trying to use the entityconverter with this?
Peter, I exactly followed the ui example in Seam 1.2.0.
1. added following code in components.xml:<framework:entity-query name="categories" ejbql="select c from Category c" />
2. created Converters class, and added the convert code as same as the ui example. -
4. Re: Questions on s:selectItems
pmuir Mar 3, 2007 12:05 PM (in response to gus888)<framework:entity-query name="categories" ejbql="select c from Category c" entity-manager="#{em}"/>
-
5. Re: Questions on s:selectItems
gus888 Mar 3, 2007 12:24 PM (in response to gus888)Thank you so much, Peter.
Gus