-
1. Re: urgent beginner question
asookazian May 17, 2010 6:08 AM (in response to mpelaez)@Name("a") @Scope(ScopeType.CONVERSATION) class A{ private Father obj; @In private B b; public void M(){ b.getSon().setFather(this.obj); b.setName("Eduard"); } } @Name("b") class B{ private Son son; }
what do you mean exactly by
if after I call b.son
? -
2. Re: urgent beginner question
mpelaez May 17, 2010 2:56 PM (in response to mpelaez)I mean if I have another method in class B that called oject son, for example:
boolean M(){
if(this.son.getName().Equals(Eduard
))
return true;
return false;
}when I call this method from presentation the object son is null even when It was created in class A.
-
3. Re: urgent beginner question
asookazian May 17, 2010 5:54 PM (in response to mpelaez)You can try to outject like this:
@In @Out private B b;
make sure you outject to the same context (SFSBs are conversation-scoped by default but JavaBeans are event-scoped).
Then that instance will be available in another Seam component.
-
4. Re: urgent beginner question
asookazian May 17, 2010 5:56 PM (in response to mpelaez)or you can provide a getB() method in class A and inject A into B.
-
5. Re: urgent beginner question
mpelaez May 17, 2010 6:03 PM (in response to mpelaez)ok, thanks. I am going to tried that.
should I put to JavaBeans conversation scope??
B b is a ssesion bean but the object son inside b is an entity bean -
6. Re: urgent beginner question
mpelaez May 17, 2010 6:06 PM (in response to mpelaez)I do not realy like doing of that way, I prefer tried the outjection. Thanks a lot for you help and sorry for the bad english.