I'm trying out Pagination and I have a weird problem :
Whenever the total number of my input in multiple's of 10's (eg, 10, 30, 100 etc, and its 40 in current problem), the pagination will give me an EXTRA page.
Say I want to show 10 records/results per "pagination page", it will display the first 40 perfectly. 1-10 (page 1 of 4), 11-20 (page 1 of 4), 21-30 (page 1 of 4), 31-40 (page 1 of 4).
It will ALSO display an empty page (page 5 of 4).
I am unable to find the cause of this "problem".
Any help in pinning down the cause would be HIGHLY appreciated.
integer i=1;<41;i++
. In another place you're starting withcounter = 0
and adjusting for it by adding 1 to your code elsewhere. Be consistent. I think this is the source of your issue. Usei=0;<40;i++
and account for the same adjustments everywhere.