You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2005/09/28 23:33:11 UTC

if-else

<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. 

Re: if-else

Posted by Dave <ja...@yahoo.com>.
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 <rw...@us.ibm.com> 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 <an...@gmail.com> 
09/28/2005 05:37 PM Please respond to
"MyFaces Discussion"


To
MyFaces Discussion <us...@myfaces.apache.org> cc
Subject
Re: if-else




Use facelets. Then you can use the JSTL if & choose/when/otherwise tags

On 9/28/05, Dave <javaone9@yahoo.com > 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. 

Re: if-else

Posted by Ryan Wynn <rw...@us.ibm.com>.
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 <an...@gmail.com> 
09/28/2005 05:37 PM
Please respond to
"MyFaces Discussion"


To
MyFaces Discussion <us...@myfaces.apache.org>
cc

Subject
Re: if-else






Use facelets. Then you can use the JSTL if & choose/when/otherwise tags

On 9/28/05, Dave <javaone9@yahoo.com > 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. 


Re: if-else

Posted by Andrew robinson <an...@gmail.com>.
Use facelets. Then you can use the JSTL if & choose/when/otherwise tags

On 9/28/05, Dave <ja...@yahoo.com> 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 <http://store.yahoo.com/redcross-donate3/> to the
> Hurricane Katrina relief effort.
>
>