ui:repeat and h:panelGrid

后端 未结 1 1500
臣服心动
臣服心动 2020-12-06 02:07

When using something like


    
        

        
相关标签:
1条回答
  • 2020-12-06 02:24

    The output is fully as expected and specified. The <ui:repeat> is a render time tag, not a view build time tag like <c:forEach>. After building the view, <h:panelGrid> ends up with 1 child component (the <ui:repeat> itself), not with n <h:outputText> components like as with <c:forEach>.

    You need a <h:dataTable> instead. It's designed for exactly this purpose.

    <h:dataTable var="o" value="#{mybean.list}">
        <h:column>
            <h:outputText value="#{o.text}"/>
        </h:column>
    </h:dataTable>
    

    See also:

    • JSTL in JSF2 Facelets... makes sense?
    0 讨论(0)
提交回复
热议问题