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 Best way to display/not display a div based on a value in my JavaBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Best way to display/not display a div based on a value in my JavaBean" Watch "Best way to display/not display a div based on a value in my JavaBean" New topic
Author

Best way to display/not display a div based on a value in my JavaBean

Chris Stewart
Ranch Hand

Joined: Sep 29, 2001
Posts: 124
In JSF, what's the best way to display or not display a div based on the value in one of my JavaBeans? In JSP, I imagine I'd just use Java code to do this, but in JSF I'm told that's a no-no. So, any suggestions?
Jason Lee
Greenhorn

Joined: Mar 03, 2008
Posts: 12
Originally posted by Chris Stewart:
In JSF, what's the best way to display or not display a div based on the value in one of my JavaBeans? In JSP, I imagine I'd just use Java code to do this, but in JSF I'm told that's a no-no. So, any suggestions?


In "plain" JSF, you can do

<h:panelGroup rendered="...">

Seam offers a s:div, and Facelets offers ui:fragment if you happen to be using either of those.


Jason Lee, SCJP
Senior Member of Technical Staff with Oracle
http://blogs.steeplesoft.com
Chris Stewart
Ranch Hand

Joined: Sep 29, 2001
Posts: 124
I am using Facelets and ui:fragment did the trick. Thanks for the tip!
Jason Lee
Greenhorn

Joined: Mar 03, 2008
Posts: 12
Originally posted by Chris Stewart:
I am using Facelets and ui:fragment did the trick. Thanks for the tip!

Very good!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best way to display/not display a div based on a value in my JavaBean
 
Similar Threads
Architecture Advice Required: to JSP or not ?
shrinking a div vertically
json object send to JSF backing bean to xhtml page
Changing the value of a rich:comboBox
How to create horizontal line in jsf