Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The right JSF component to represent a HTML <code>&lt;div&gt;</code> element is the <code>&lt;h:panelGroup&gt;</code> with the <code>layout</code> attribute set to <code>block</code>. So, this should do:</p> <pre class="lang-html prettyprint-override"><code>&lt;h:panelGroup layout="block" ... rendered="#{someCondition}"&gt; ... &lt;/h:panelGroup&gt; </code></pre> <p>Alternatively, wrap it in an <code>&lt;ui:fragment&gt;</code>:</p> <pre class="lang-html prettyprint-override"><code>&lt;ui:fragment rendered="#{someCondition}"&gt; &lt;div&gt; ... &lt;/div&gt; &lt;/ui:fragment&gt; </code></pre> <p>Do note that when you'd like to ajax-update a conditionally rendered component, then you should be ajax-updating its parent component instead.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/3713468/alternative-to-uifragment-in-jsf/">Alternative to ui:fragment in JSF</a></li> <li><a href="https://stackoverflow.com/questions/15946985/conditional-rendering-of-non-jsf-components-plain-vanilla-html-and-template-tex/">Conditional rendering of non-JSF components (plain vanilla HTML and template text)</a></li> <li><a href="https://stackoverflow.com/questions/14790014/ajax-update-render-does-not-work-on-a-component-which-has-rendered-attribute">Ajax update/render does not work on a component which has rendered attribute</a></li> <li><a href="https://stackoverflow.com/questions/9010734/why-do-i-need-to-nest-a-component-with-rendered-some-in-another-component-w">Why do I need to nest a component with rendered=&quot;#{some}&quot; in another component when I want to ajax-update it?</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload