You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matt Hughes <mh...@chariotsolutions.com> on 2006/07/11 21:36:58 UTC

Should ValueBindings inside rendered="false" be evaluated?

If you have the following code:

<t:div rendered="false">
    <h:outputText value="#{backingBean.someGetterMethod}" />
</t:div>

Should getSomeGetterMethod() be invoked?  My initial thought was if the 
parent's rendered attribute was false, the value binding expression 
*shouldn't* be evaluated.  Using MyFaces 1.1.1 and Facelets 1.10, it is 
being evaluated. 

Ideally if rendered is false, than I don't want all the ValueBinding 
expressions underneath that tag to be evaluated. 

Any thoughts?



Re: Should ValueBindings inside rendered="false" be evaluated?

Posted by ldr <ch...@niro-it.dk>.
Try binding the div...

I dont think it will work but its worth a shot.

chris
-- 
View this message in context: http://www.nabble.com/Should-ValueBindings-inside-rendered%3D%22false%22-be-evaluated--tf1926699.html#a5282038
Sent from the MyFaces - Users forum at Nabble.com.


Re: Should ValueBindings inside rendered="false" be evaluated?

Posted by Matt Hughes <mh...@chariotsolutions.com>.
It doesn't iterate over the children <h:column /> tags but it does call 
ValueBinding.setValue() on an important attribute that in my opinion it 
should ignore when rendered=false: <t:dataTable 
value="#{backingBean.theList}" >.

If you have a table defined as follows, even with rendered="false", it 
still calls ValueBinding.setValue() on the value attribute of the 
dataTable.  In the simple example I made, it is just a List of 
hard-coded objects.  But normally that is a List populated from a 
database query. I shouldn't be making db calls if I am not going to show 
the resultant data.  But the only way to do a lazy-loading of this 
property is with the hack of binding the component and checking the 
isRendered() flag in your getter method.

<t:dataTable value="#{schedule.theList}" var="entry" rendered="false">
  <t:column>#{entry.value}</t:column>
</t:dataTable>


Matthias Wessendorf wrote:
> I think that div doesn't care about it's children
>
> dataTable for instance does.
>
> -Matthias
>
> On 7/11/06, Matt Hughes <mh...@chariotsolutions.com> wrote:
>> If you have the following code:
>>
>> <t:div rendered="false">
>>     <h:outputText value="#{backingBean.someGetterMethod}" />
>> </t:div>
>>
>> Should getSomeGetterMethod() be invoked?  My initial thought was if the
>> parent's rendered attribute was false, the value binding expression
>> *shouldn't* be evaluated.  Using MyFaces 1.1.1 and Facelets 1.10, it is
>> being evaluated.
>>
>> Ideally if rendered is false, than I don't want all the ValueBinding
>> expressions underneath that tag to be evaluated.
>>
>> Any thoughts?
>>
>>
>>
>
>


Re: Should ValueBindings inside rendered="false" be evaluated?

Posted by Matthias Wessendorf <ma...@apache.org>.
I think that div doesn't care about it's children

dataTable for instance does.

-Matthias

On 7/11/06, Matt Hughes <mh...@chariotsolutions.com> wrote:
> If you have the following code:
>
> <t:div rendered="false">
>     <h:outputText value="#{backingBean.someGetterMethod}" />
> </t:div>
>
> Should getSomeGetterMethod() be invoked?  My initial thought was if the
> parent's rendered attribute was false, the value binding expression
> *shouldn't* be evaluated.  Using MyFaces 1.1.1 and Facelets 1.10, it is
> being evaluated.
>
> Ideally if rendered is false, than I don't want all the ValueBinding
> expressions underneath that tag to be evaluated.
>
> Any thoughts?
>
>
>


-- 
Matthias Wessendorf

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com