Does anyone know a way to get the index of the element in a ui:repeat facelets tag?
<ui:repeat id="topTenGrd" var="dream" value="#{dreamModifyBean.topDreams}">
<h:outputText class="dream-title uppercase" value="#{dream.number}. #{dream.title}" />
</ui:repeat>
Specify a value for the "varStatus" attribute:
<ui:repeat id="..." var="..." value="..." varStatus="myVarStatus">
You can then access the loop index via EL:
#{myVarStatus.index}
Additionally, the following properties are available to the varStatus:
For more details, see:
https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/ui/repeat.html