-
1. Re: Do all injectable beans need a Provider class?
cbrock Aug 25, 2011 3:20 AM (in response to craiggreenhalgh)We do support @Produces in our Errai-CDI extension, yes. It is not currently a feature of the core IOC framework: https://docs.jboss.org/author/display/ERRAI/CDI+Reference+Guide#CDIReferenceGuide-CDIProducers
-
2. Re: Do all injectable beans need a Provider class?
craiggreenhalgh Aug 25, 2011 3:47 AM (in response to cbrock)So if I have bean that has a @Producer method for 'User'
When the view is craeted via
return GWT.create(LoginViewImpl.class);
The view will have the @Injected 'User' set ?
Thanks for your help
Craig
-
3. Re: Do all injectable beans need a Provider class?
cbrock Aug 25, 2011 12:52 PM (in response to craiggreenhalgh)No, we can't inject into externally generated code, unless the code is being generated through our bootstrapper.
Do you have your own generator for LoginView?
-
4. Re: Do all injectable beans need a Provider class?
craiggreenhalgh Aug 26, 2011 5:30 AM (in response to cbrock)Hi thanks again for your help.
In the example in CDI Producers, https://docs.jboss.org/author/display/ERRAI/CDI+Reference+Guide
How should the class MyComposite be instanited in order for the value of my MyBaseWidget to be injected?
Should this be new MyComposite() or GWT.create(MyComposite.class)
Thanks again
Craig
-
5. Re: Do all injectable beans need a Provider class?
csa Aug 26, 2011 9:59 AM (in response to craiggreenhalgh)It should be subject to injection as well (so MyComposite shouldn't be manually instantiated). You could have it injected it into your module class for instance. For that it will need an @ApplicationScoped annotation though. I just updated the docs.
-
6. Re: Do all injectable beans need a Provider class?
craiggreenhalgh Aug 26, 2011 10:42 AM (in response to csa)Could I also have these composites as Request scoped?
Thanks again
Craig
-
7. Re: Do all injectable beans need a Provider class?
csa Aug 26, 2011 10:57 AM (in response to craiggreenhalgh)No, currently only @ApplicationScoped is supported on the client. We are looking into supporting passivating scopes in a future release.
-
8. Re: Do all injectable beans need a Provider class?
craiggreenhalgh Aug 31, 2011 3:15 AM (in response to csa)Thanks for you help guys,
The support of RequestScope would be great, as I could then inject a new view without having to call a "reset" method / manually instanciating a new one
Thanks again,
Craig