-
1. Re: Injection issue
christian.bauer Apr 3, 2007 4:45 PM (in response to monkeyden)The @Factory method is not necessary. And I don't think what you think it does is what it is actually for.
-
2. Re: Injection issue
monkeyden Apr 3, 2007 4:52 PM (in response to monkeyden)The @Factory method is not necessary.
This was the next thing I tried after normal @In(create=true) didn't work.And I don't think what you think it does is what it is actually for.
Care to enlighten me? Given the definition below, I thought I was using it correctly.Marks a method as a factory method for a context variable. A factory method is called whenever no value is bound to the named context variable, and is expected to initialize the value of the context variable.
-
3. Re: Injection issue
pmuir Apr 3, 2007 5:01 PM (in response to monkeyden)At the very least you are confusing Seam by providing two ways to initialise your paginator (a component and a factory). required=false,create=true doesn't make sense to me
-
4. Re: Injection issue
monkeyden Apr 3, 2007 5:29 PM (in response to monkeyden)Given that the component does not exist on first access, I would like it to be created, injected and save it to session. So how do you suggest it be annotated? The component itself looks correct, I assume.
-
5. Re: Injection issue
pmuir Apr 3, 2007 5:34 PM (in response to monkeyden)@In(create=true) - if it does exist in scope it will be injected, if it doesn't exist it will be created and injected
-
6. Re: Injection issue
monkeyden Apr 3, 2007 5:42 PM (in response to monkeyden)Yeah, I tried that. It didn't work, which is what made me wonder about the requirements of the injected component. I always thought that the injected component just needed a @Name and a no-arg constructor, and Seam would handle the rest (Component.getInstance, I presume).
Caused by: org.jboss.seam.RequiredException: In attribute requires value for component: advancedSearchAction.paginator -
7. Re: Injection issue
monkeyden Apr 3, 2007 6:25 PM (in response to monkeyden)Can someone at least confirm that these are the base requirements to be able to inject a component? A simple JavaBean should work shouldn't it? The tutorial doesn't explicitly say what is necessary, and my bean doesn't appear to be any different than what I've seen injected in there.
-
8. Re: Injection issue
anescu Apr 25, 2007 9:21 AM (in response to monkeyden)Hi,
I got the same error.
If I put just@In(create = true) UserHome lastUpdatedBy;
I get an exception about not-null value for that component (when some other's component list is called - a component reffering the first one)
If I put@In(required = false, create = true) UserHome lastUpdatedBy;
I get an exception latter when I try to "add" a new object.
More specific in the wire() method lastUpdatedBy is null and I get a NullPointerException.