aspose file tools*
The moose likes JSF and the fly likes JSF conditional HTML 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 "JSF conditional HTML" Watch "JSF conditional HTML" New topic
Author

JSF conditional HTML

kent snow
Greenhorn

Joined: Apr 15, 2007
Posts: 2
I have the following code I would like to be displayed if a list in a backing bean contains one or more elements:

<div id="header_tabs">
<ul>
<li id="tab-payment" class="on">Adjustments</li>
<li id="tab-summary">Summary</li>
<li id="tab-confirmation">Confirmation</li>
</ul>
</div>

The text is always static. I tried to use <c:if but that could not find the value of my JSF backing bean. What is the best practice for this? Any suggestions even for a temporary fix?
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
use the rendered attribute of the h:div tag.


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
kent snow
Greenhorn

Joined: Apr 15, 2007
Posts: 2
That only pertains to the DIV tag itself, not what is between the tag, so it does not solve the problem with the ul / li tags. I believe there is a list tag in the apache tag lib. However, does anyone know how I can use a rendered tag logic around a block of HTML between the tags to be displayed?

<f: ??? rendered=�my condition�>
<div >
<blah �>
<a �>
</div >
</f: ??? >
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Originally posted by kent snow:
That only pertains to the DIV tag itself, not what is between the tag, so it does not solve the problem with the ul / li tags.


Why doesn't it? If you turn the div off, the contents of the div will not be displayed, which is what you want, no?


GenRocket - A Test Data Generation Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF conditional HTML
 
Similar Threads
How to compute the count of html_tag each line?
Tab Menu
Tooltip : help about menu with link
Problem with YUI tabs while populating pdf's
How can I have a TAB inside my JSP