If your having performance problems then submit a patch 
allowing the implementation to call #{bean.booleanFunction} 
only once for a given phase in the cycle, assuming this 
behavior is still ok w/ the spec.  I don't think it's going 
to get very far however since the resources used to evaluate 
an EL binding are insignificant compared to the real bottle 
necks we face, like SOAP requests or table scans.  BTW, it's 
@rendered, not @render.


---- Original message ----
>Date: Wed, 28 Sep 2005 17:46:03 -0700 (PDT)
>From: Dave <[EMAIL PROTECTED]>  
>Subject: Re: if-else  
>To: MyFaces Discussion <[email protected]>
>
>   That is OK  for this simple case. But for rendering
>   different UI components based on logic
>   <h:outputText value="ABC"
>   render="#{bean.booleanFunction }" />
>   <h:inputHtml value="ABC"
>   render="#{!bean.booleanFunction}"/>
>
>   Ryan Wynn <[EMAIL PROTECTED]> wrote:
>
>     My personal opinion is keep if-else/jstl away from
>     jsf.  I like to put logic evaluation in backing
>     beans and a keep the MVC distinction clear.
>
>     Couldn't you do
>
>     <h:outputText value="#{bean.threeLetters}" /> and
>     do the logic in threeLetters
>
>     Instead of
>
>     <h:outputText value="ABC"
>     render="#{bean.booleanFunction }" />
>     <h:outputText value="EFG"
>     render="#{!bean.booleanFunction}"/>
>
>     I think it's just a matter of preference.
>
>Andrew robinson                     To MyFaces 
Discussion         
><[EMAIL PROTECTED]>         
<[email protected]> 
>                                    
cc                            
>09/28/2005 05:37 PM            Subject Re: if-
else                
>                                                             
     
>+----------------------+       
>|  Please respond to   |       
>| "MyFaces Discussion" |       
>+----------------------+       
>
>     Use facelets. Then you can use the JSTL if &
>     choose/when/otherwise tags
>     On 9/28/05, Dave <[EMAIL PROTECTED] > wrote:
>     <h:outputTex value="ABC"
>     render="#{bean.booleanFunction }" />
>     <h:outputTex value="EFG"
>     render="#{!bean.booleanFunction}"/>
>      
>     If JSF supports If-else tags, it wll improve
>     performance, and code readability. The
>     booleanFunction should be called only once instead
>     of twice. Any plan to add IF-ELSE? or other nice
>     tag libraries going well with JSF? Thanks. Dave
>
>     ------------------------------------------------
>
>     Yahoo! for Good
>     Click here to donate to the Hurricane Katrina
>     relief effort.
>
>     ------------------------------------------------
>
>   Yahoo! for Good
>   Click here to donate to the Hurricane Katrina relief
>   effort.
Dennis Byrne

Reply via email to