开发者

c:forEach doesn't render inside rich:dataTable

开发者 https://www.devze.com 2022-12-18 06:41 出处:网络
I am using c:forEach inside rich:dataTable. But c:forEach doesn\'t substitute the values for answer.choices variable and hence nothing is rendered. Is it wrong to use c:forEach inside a rich:dataTable

I am using c:forEach inside rich:dataTable. But c:forEach doesn't substitute the values for answer.choices variable and hence nothing is rendered. Is it wrong to use c:forEach inside a rich:dataTable?

开发者_开发知识库


Yes, it doesn't work - don't use JSTL tags inside UI iteration components (dataTable, for example).

Use <ui:repeat> or <a4j:repeat> instead of <c:forEach> to iterate inside a dataTable

The signature of these tags is a little different:

<a4j:repeat value="#{bean.items}" var="item">
   <h:outputText value="#{item}" />
</a4j:repeat>


You should be aware of compile-time vs. render-time tags in jsf. It's the key to understanding the reason why this combination can't work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号