row counter for html table row

crazyTechie picture crazyTechie · Dec 30, 2009 · Viewed 21.7k times · Source

I have HTML table in JSF web application. I am generating rows dynamically using <ui:repeat>. I want a counter for each row. How can I get this? Any help?

Ssimilar to rowKeyVar in rich faces dataTable.

Answer

ustun picture ustun · Oct 14, 2011

As of Facelets 2.0, this is now possible using the varStatus.

<ui:repeat varStatus="status" var="user" value="#{collection}">
     #{status.index}
</ui:repeat>