I\'m building a rich datatable with a dynamic amount of columns. It seems to me, that it is not a big thing, but I\'m trying to get an answer since hours. The issue is when
I think <ui:repeat>
doesn't work because <rich:column>
is not what ui:repeat is designed to deal with (e.g. a <li>
or something like that), <a4j:repeat>
which you should be using instead won't work there either (and that has something to do with the way the table is built).
<c:forEach>
will work, with a little hack:
<c:forEach var="index" begin="0" end="#{reportingModel.columns - 1}">
<rich:column style="text-align:right;">
<h:outputText value="#{reportingDoiPoolRow.amountOfDois.get(index)}" />
</rich:column>
</c:forEach>
<c:forEach>
does not have access to the attributes from <rich:dataTable>
(well, it has access to rowKeyVar
but that will be always 1) so you'll have to ask the bean directly for the column size but the pieces rendered by <c:forEach>
will have access to the var
.