This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF conditional HTML  RSS feed

 
kent snow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the rendered attribute of the h:div tag.
 
kent snow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!