Reputation: 9943
I can't believe I am asking this after all these months of coding JSF 2.0 pages, but this is the first I have run into this.
I often have an h:output tag like this:
<h:outputText value="Some sage wisdom" rendered=#{backbean.includeWisdom} style="..." />
What tag do I use if the text to conditionally include is large -- like paragraphs long? I also want to keep the style attribute.
Upvotes: 1
Views: 539
Reputation: 30025
You can use a h:panelGroup
for this purpose.
<h:panelGroup rendered="#{backbean.includeWisdom}" style="...">
Your text
</h:panelGroup>
From the taglib documentation:
If the "style" or "styleClass" attributes are present, and the "layout" attribute is present with a value of "block", render a "div" element, outputting the value of the "style" attribute as the value of the "style" attribute and the value of the "styleClass" attribute as the value of the "class" attribute.
Otherwise, if the "layout" attribute is not present, or the "layout" attribute contains a value other than "block", render a "span" element, outputting the value of the "style" attribute as the value of the "style" attribute, and the value of the "styleClass" attribute as the value of the "class" attribute.
Upvotes: 3