-
1. Re: Accessing Factory from other Classes
gonorrhea Apr 5, 2009 3:46 AM (in response to oyesiji77)Assuming your Seam component is conversation-scoped (which is default for SFSB), then jobCategorySelectService will be outjected to conversation context and will be available for injection during the conversation.
The key is bijection (injection + outjection + disinjection). You outject from component A to scope X and inject that variable into component B.
-
2. Re: Accessing Factory from other Classes
oyesiji77 Apr 5, 2009 3:56 AM (in response to oyesiji77)when i injected the Factory jobCategorySelectService in my other component, I discovered it was null by the way jobCategorySelectService is application Scoped
public class Component2{
@In("#{jobCategorySelectService}")
List<SelectItem> jobCategorySelectService;
} -
3. Re: Accessing Factory from other Classes
gonorrhea Apr 5, 2009 4:08 AM (in response to oyesiji77)application scope is the broadest scope in Seam. Was it ever set to something other than null prior to the outjection? Once an object is set to a non-null value in application scope, then it will be available until the app server is restarted unless it is set to null during the course of the app.
Also, typically when you inject, you simply use @In.
@In("#{jobCategorySelectService}) is most likely wrong syntax.
In this case @In is equivalent to @In("jobCategorySelectService").
Seam defaults to the instance name of the injected object if you don't specify it.
-
4. Re: Accessing Factory from other Classes
oyesiji77 Apr 5, 2009 6:37 AM (in response to oyesiji77)Its working now thanks made a mistake about the Scope