-
1. Re: loosing seam initialization (in particular injection) wh
pmuir Feb 5, 2008 6:26 PM (in response to cyberanto)You can't instantiate a Seam component using the new operator - you must use injection or Component.getInstance()
-
2. Re: loosing seam initialization (in particular injection) wh
cyberanto Feb 6, 2008 12:42 PM (in response to cyberanto)Thanks Pete, Component.getInstance() works.
I still have an issue where a (legacy) DAO is returning a list of e.g. CatalogModel and the user selects one. With JSF, it is easy to set the backing bean to a particular object. The equivalent method in Seam, Context.set(name, object) sets the object, but does not initialize it as a Seam component.
I have started to look at your source code, have not yet found the salient point where an object returned by the EntityManager is turned into a Seam Bean.
What am I missing? -
3. Re: loosing seam initialization (in particular injection) wh
cyberanto Feb 6, 2008 3:29 PM (in response to cyberanto)Oh, I see you are doing Class.newInstance() in Home.createInstance() and this will initialize correctly.
Or you are using the EntityManager to return a properly initialized object ... as in the wiki example ... of course these objects get created new also before being populated