File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Conditional logic in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Conditional logic in JSF" Watch "Conditional logic in JSF" New topic
Author

Conditional logic in JSF

Kalyan Anand
Ranch Hand

Joined: Feb 07, 2007
Posts: 194
I have the following code in JSF which displays a Settings URL . The URL needs to be hiiden when the parameter is null.

I was thinking about the best approach to do it. The obvious and easitest approach I see is using JSP <c:if>. Any thoughts on how this can be pertformed with other mechanisms and which one is considered better appproach ?

Kalyan Anand
Ranch Hand

Joined: Feb 07, 2007
Posts: 194
Any answers on this one ???
Rodrigo Lazoti
Greenhorn

Joined: Mar 13, 2009
Posts: 9
You're can use the rendered attribute. Example:



Rodrigo Lazoti.
blog: http://www.rodrigolazoti.com.br
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Just to be pedantic (or was that p├Ždantic?), conditional logic (meaning business logic or wholesale rearrangement of view components) is something that you should not place in a View. It's a violation of the MVC separation of concerns.

Conditional rendering, on the other hand, is another matter.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conditional logic in JSF
 
Similar Threads
dynamic fields display
How to pass dynamic value to resource bundle param like {0}
Myfaces 2.0.6-Getting Conversion error when extending class or implementing interface
Repeating JSF code
Need help in display the page number in the data scroller