开发者

c:forEach doesn't render inside 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜