This content has been marked as final.
Show 3 replies
-
1. Re: Injection fail, design problems
niox.nikospara.yahoo.com Nov 23, 2009 4:29 PM (in response to fmontezuma)Hello,
I would suggest creating the ActionEvents in a @Create method:
@Name("action") public class Action { @In private EntityManager entityManager; private ActionEvents events; public Action() { } @Create public create() { this.events = new ActionEvents(this); } // other methods // getters and setters }
-
2. Re: Injection fail, design problems
fmontezuma Nov 23, 2009 5:47 PM (in response to fmontezuma)I tried that already... It doesn't work too.
I mean, I can't get EntityManager or FacesContext injected in my Action bean.
And the ActionBean is conversation scoped. I missed typing that.
Any other advice?
Thanks
-
3. Re: Injection fail, design problems
fmontezuma Nov 23, 2009 6:48 PM (in response to fmontezuma)I tried something else, injecting Action inside ActionEvents.
Seems that Seam doesn't try to inject objects when I use the composition pattern in the EL:
#{action.events.select_onclick}.
I named my ActionEvents to actionEvents and used the EL #{actionEvents.select_onclick} to use it and now it works.