myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin mcKay" <justinmc...@gmail.com>
Subject [Trinidad] question about the binding attribute when a parent copmonent is setting rendered to false
Date Tue, 22 Jul 2008 22:43:31 GMT
I have a question about  the binding attribute  when a parent copmonent is
setting rendered to false.  Say I have a panelGroupLayout tag that has the
rendered attribute set to false.  Then a child to that panelGroupLayout is
an inputText tag that has  the attribute binding set to a backing bean.  My
assumption was since the binding was the only reference to the backing bean
and the component is not being rendered (based on the parent) then the bean
should not be created and the set method to the binding should not be fired.
However the bean is still created and the binding is still set.  Is this
correct?

 

I provided the sample code below..

 

Java Code..

 

public class CheckBinding {

      private CoreInputText textComp;

 

      public CheckBinding(){

            System.out.println("Bean is being created");

      }

 

      /**

       * @param textComp the textComp to set

       */

      public void setTextComp(CoreInputText textComp) {

            this.textComp = textComp;

      }

 

      /**

       * @return the textComp

       */

      public CoreInputText getTextComp() {

            return textComp;

      }

}

 

JSF Code..

 

<tr:form>

      <tr:panelGroupLayout rendered="false">

            <tr:inputText binding="#{testBinding.textComp}"></tr:inputText>

      </tr:panelGroupLayout>

</tr:form>

 

Bean Definition.

 

<managed-bean>

      <managed-bean-name>testBinding</managed-bean-name>

 
<managed-bean-class>com.faces.bean.test.CheckBinding</managed-bean-class>

      <managed-bean-scope>request</managed-bean-scope>

</managed-bean>

 

 

 

 


Mime
View raw message