Well, the easiest thing to do would be to use

<managed-bean>
   <managed-bean-name>commandsController</managed-bean-name>
   
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SearchCommandsController</managed-bean-class>
   <managed-bean-scope>none</managed-bean-scope>
   <managed-property>
       <property-name>categorySelector</property-name>
       <value>#{categorySelector}</value>
   </managed-property>
</managed-bean>

However, I must admit that I've never understood the use of scope=none.

But if you want to hard-code references to your beans using java code,
it can be done like this:

       ValueBinding binding =
FacesContext.getCurrentInstance().getApplication().createValueBinding("#{categorySelector}");
       Object categorySelector =
binding.getValue(FacesContext.getCurrentInstance());

Or like this:

       Object categorySelector =
FacesContext.getCurrentInstance().getApplication().getVariableResolver().resolveVariable(FacesContext.getCurrentInstance(),
"categorySelector");


On 4/26/07, Leyzerzon, Simeon <[EMAIL PROTECTED]> wrote:



Hi,

Could you please give me a hand with the syntax:  I have a hierarchy of
managed beans and need to be able to resolve the value of one sibling
property bean from within another.  For example, based on the following
setup, I need to resolve current property values of categorySelector bean
from within searchCommandsController bean.  What would the syntax be?

I have a following setup:

<managed-bean>
 <managed-bean-name>searchHandler</managed-bean-name>

<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SearchHandler</managed-bean-class>
  <managed-bean-scope>session</managed-bean-scope>

    <managed-property>

<property-name>reportingPeriodSelector</property-name>
                         <value>#{selectReportingPeriods}</value>
    </managed-property>


    <managed-property>
                        <property-name>categorySelector</property-name>
                         <value>#{selectCategories}</value>
    </managed-property>

    <managed-property>
                        <property-name>intervalSelector</property-name>
                         <value>#{selectIntervals}</value>
    </managed-property>

    <managed-property>
                        <property-name>userActionSelector</property-name>
                         <value>#{selectUserActions}</value>
    </managed-property>

    <managed-property>

<property-name>searchCommandsController</property-name>
                         <value>#{commandsController}</value>
    </managed-property>
</managed-bean>


<managed-bean>
 <managed-bean-name>selectReportingPeriods</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SelectReportingPeriods</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
 </managed-bean>

 <managed-bean>
 <managed-bean-name>selectCategories</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SelectCategories</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
 </managed-bean>

 <managed-bean>
 <managed-bean-name>selectIntervals</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SelectInterval</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
 </managed-bean>

 <managed-bean>
 <managed-bean-name>selectUserActions</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SelectUserAction</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>


<managed-bean>
 <managed-bean-name>commandsController</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.SearchCommandsController</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
</managed-bean>

Thanks in advance.
Simeon

==============================================================================
Please access the attached hyperlink for an important electronic
communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================




Reply via email to