-
1. Re: Outjecting values after some action, not at component creation time
marios Dec 5, 2008 10:37 AM (in response to marios)Just to add some more detail, I also tried the @Factory:
@Name( "bean1" ) Scope( CONVERSATION ) public Bean1 { public String next() { // Do nothing ... return "ok"; } @Factory( "item" ) public Item findItem() { // Find the item return item; } }
But still no hope.
-
2. Re: Outjecting values after some action, not at component creation time
cosmo Dec 5, 2008 1:17 PM (in response to marios)Did you define an explicit conversation?
-
3. Re: Outjecting values after some action, not at component creation time
stells Dec 5, 2008 2:44 PM (in response to marios)Did you try @Factory together with @Out?
-
4. Re: Outjecting values after some action, not at component creation time
marios Dec 7, 2008 8:34 PM (in response to marios)
Michail Galvidis wrote on Dec 05, 2008 14:44:
Did you try @Factory together with @Out?No luck: it just wants the @Out to be not null at component creation time! Which makes me think twice since I've read on
Seam in action
(fig. 6.2, page 223) that it should just behave as I expected. That is:- @Inject before invoking the method
- Execute the method (where I'm going to initialize the fields I want to outject)
- @Outject the fields
No idea.
-
5. Re: Outjecting values after some action, not at component creation time
stells Dec 8, 2008 8:55 AM (in response to marios)To by honest, I have not read Seam in Action yet and I'm quite new to Seam. But the three steps you mentioned do not look as outjection and are more similar to bijection. Meanwhile your usecase needs oujection only.
The @Out clause do need to have required=false. Otherwise you get the error.
So your code should function as you expect. At least I see it functioning when I try it.
-
6. Re: Outjecting values after some action, not at component creation time
ngagov Dec 28, 2008 8:43 PM (in response to marios)If you remove 'item' from conversation scope(simply set item = null;) inside next() method, it's factory method will be invoked again