-
1. Re: getting ManagedBean out of Conversation
damianharvey Nov 5, 2007 8:19 AM (in response to jamesjmp)Are you trying to access a different Bean than what you have called the method on? ie. your s:button called BeanA and you want to access properties of BeanB.
If so, then assuming BeanB has been outjected into the Conversation scope, you just need to inject BeanB into your BeanA. eg in BeanA.java :@In BeanB beanB;
or if you'd rather call it inline:if(getConversation()!= null) { //Aqui me cargo la conversacion si es que existe System.out.println("conversation ID " .concat(getConversation().getId())); //access to managed bean in Conversation BeanB beanB = (BeanB)Component.getInstance("beanB"); }
Cheers,
Damian. -
2. Re: getting ManagedBean out of Conversation
jamesjmp Nov 5, 2007 9:35 AM (in response to jamesjmp)thank you, but I want to access to the same bean. I´ll explain myself a bit further:
I´ve a form to create a new POJO. I´m using flush-mode="manual" in the .page.xml, and while filling the info in the wire or whatever method of the pojoHome I´ve no way of accessing to the info filled up to that moment. If I save and invoke persist(), then the info is saved withouth problem. What, before submitting I want to access some values to make some process with them.
So, I want to access to the info that I have entered for instance in field 2, but before pressing a h:commandButton.
Checking in that moment pojoHome´s instance values are null. That´s way I thought about using conversation in caes it helped.
any idea?