Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The output is fully as expected and specified. The <code>&lt;ui:repeat&gt;</code> is a render time tag, not a view build time tag like <code>&lt;c:forEach&gt;</code>. After building the view, <code>&lt;h:panelGrid&gt;</code> ends up with 1 child component (the <code>&lt;ui:repeat&gt;</code> itself), not with <em>n</em> nested <code>&lt;h:panelGrid&gt;</code> components like as you would get with <code>&lt;c:forEach&gt;</code>. </p> <pre><code>&lt;html ... xmlns:c="http://java.sun.com/jsp/jstl/core"&gt; ... &lt;h:panelGrid id="resourcePanel" columns="5" rules="all"&gt; &lt;c:forEach var="res" items="#{resourceUpload.resources}"&gt; &lt;h:panelGrid columns="1" rules="none"&gt; &lt;h:graphicImage value="/image/resource?id=#{res.idAsString}" style="width:100px;" /&gt; &lt;h:outputText value="#{res.name}" /&gt; &lt;/h:panelGrid&gt; &lt;/c:forEach&gt; &lt;/h:panelGrid&gt; </code></pre> <p><em>(this has in the Mojarra versions older than 2.1.18 however an implication on <code>#{resourceUpload}</code>: it can't be a view scoped bean, it must be request scoped due to a chicken-egg issue in view state saving/restoring; you'd need to upgrade to Mojarra 2.1.18)</em></p> <p>Your nested <code>&lt;h:panelGrid&gt;</code> makes by the way no utter sense. I'd have used <code>&lt;h:panelGroup&gt;</code> here.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense">JSTL in JSF2 Facelets... makes sense?</a> - to understand "view build time" vs "view render time" better</li> <li><a href="https://stackoverflow.com/questions/11280688/create-table-columns-dynamically-in-jsf">create table columns dynamically in JSF</a> - another similar question</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