views:

398

answers:

1

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?

+4  A: 

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>
Bozho
@Bozho Good to know (+1). But where should i avoid to use JSTL in Java Server Faces ?
Arthur Ronald F D Garcia
From JSTL only the `functions` taglib is actually useful in JSF. The JSTL `core` and `fmt` taglibs are superfluous in JSF as JSF at its own already has ways to do the same. Further the JSTL `xml` and `sql` taglibs are intented for quick prototyping only and have no business value.
BalusC
@BalusC Thank you, BalusC
Arthur Ronald F D Garcia