I just had to switch from ICEFaces dataTable to simple forEach tag, because I had to place elements in two rows rather than 1.
Anyway, now I can’t use the old paginator because it returns me an error. I know I can use begin and end attributes to define from and to what element should forEach iterate, but still I don’t know how to get it all together.
I currently have something very very simple like
<table>
<c:forEach id="content" items="#{bean.collection}" var="item">
[two well-formatted TRs]
</c:forEach>
</table>
Do you have already-done examples on how to paginate with simple first/forward/back/last buttons this table? I don’t need directly clicking on page number.
c:forEachhas abeginandendattribute (see docs), with them you can easily create pagination. You will need to have abegin,end, andlistSizeattribute in your bean.Create a first, back link if
begin==0; create forward, last link ifend<listSize. In the bean set begin and end according to the current page.If you need numbers in pagination, it is possible too, see:
http://blog.opencampaign.co.uk/index.php/2010/07/pagination-using-only-jstl.html and
http://www.coderanch.com/t/60467/oa/do-database-pagination-JSTL-tags