On 5/4/05, Rob Decker <[EMAIL PROTECTED]> wrote:
>  
> The <c:if> tag and rendered attribute are actually slightly different. 
>   
> This prevents the component from being added to the heirachy: 
>   
> <c:if test="${false}"> 
>     <h:outputText value="hello"/>
> </c:if> 
>   
> This prevents the component from being rendered but it still exists in the
> heirarchy: 
>   
> <h:outputText value="hello" rendered="false"/> 
>   
> I've found <c:if> can be useful because it does that.
>  

One cautionary note -- if you use <c:if> in this manner, components
enclosed within it should ALWAYS have an "id" value.  This avoids
problems when ids are being automatically assigned, you redisplay the
same page, and the IF condition has chaged since when the page was
originally rendered (thus, the component that was omitted before is
now included, or vice versa).

Craig

Reply via email to