How to reset the row index for p: dataList / p: dataTable on every page?
Below is an example <p:dataList>
.
<p:dataList var="row"
value="#{bean}"
first="0"
rows="10"
rowIndexVar="listRowIndex"
widgetVar="dataListUIWidget"
paginator="true"
paginatorAlwaysVisible="false"
lazy="true">
<h:outputText value="#{listRowIndex+1}"/>
</p:dataList>
This will show the row index for each row starting at 1 ( listRowIndex+1
).
How can I reset listRowIndex
on every page so that it starts at 1 on every page change (i.e. it should start at 1 on every page)?
+3
source to share
2 answers