The @Factory method is not necessary. And I don't think what you think it does is what it is actually for.
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.
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
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.
@In(create=true) - if it does exist in scope it will be injected, if it doesn't exist it will be created and injected
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
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.
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.