-----Original Message-----
From: Dennis Byrne [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 23, 2006 04:42 AM
To: [EMAIL PROTECTED]
Subject: Re: newbie question : grabbing another page bean from the session

Hello Paul,

Welcome to the MyFaces community.  You want to configure your application to 
inject a reference of page2bean into page1bean.  

  <managed-bean>
    <managed-bean-name>page1Bean</managed-bean-name>
    <managed-bean-class>xxx.Page1Bean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
         <some-element>methodOnPage1Bean<some-element>
         <other-element>#{page2Bean}<other-element>
    </managed-property>
  </managed-bean>

I'm too lazy to look up the exact element names, but I'm sure you can find this 
on Google real quick :)

You can also grab a reference to page2bean from page1bean using

FacesContext.getCurrentInstance().getApplication().createValueBinding("#{page2bean}").getValue()

Dennis Byrne

>-----Original Message-----
>From: Paul Hussein [mailto:[EMAIL PROTECTED]
>Sent: Sunday, July 23, 2006 04:35 AM
>To: users@myfaces.apache.org
>Subject: newbie question : grabbing another page bean from the session
>
>Hi,
>
>I am new to MyFaces and would like to know, if I have two page beans
>
>page1bean and page2bean, they are defined in faces-config and have session
>scope
>
>  <managed-bean>
>    <managed-bean-name>page1Bean</managed-bean-name>
>    <managed-bean-class>xxx.Page1Bean</managed-bean-class>
>    <managed-bean-scope>session</managed-bean-scope>
>  </managed-bean>
>  <managed-bean>
>    <managed-bean-name>page2Bean</managed-bean-name>
>    <managed-bean-class>xxx.Page2Bean</managed-bean-class>
>    <managed-bean-scope>session</managed-bean-scope>
>  </managed-bean>
>
>
>I want to call some methods in page2Bean (after it has been initialized and
>loaded into the session) from page1Bean. Is there a supported way to do
>this.
>
>
>
>Thanks
>
>Paul.
>




Reply via email to