I have been working on my search functionality and pagination within the results set and made good progress, but hit a road block that I cannot get my head around.
To simplify testing I used small record sets and set paging size to small numbers. In theory if the setup is correct it wont matter the page size it should just work.
I make an initial query to determine the record count of the results set and then set a bunch of states in the Pagination control I have built. These include RecordCount, ItemsPerPage, Pages Available, Current Page, ItemFrom and ItemTo.
After these are set, I use them to display in a repeating group the query but add the :item from and :item until operators.
Having read the documentation and done a few checks to determine which order the method chaining does work, I worked out that I need to perform the :item until first and then the :item from.
With a ItemsPerPage of 1 and ResultsCount of 5 it correctly sets up Pages available to 5 and Current Page to 1, the Page Next simply increments the item until and item from and re-displays in the group.
The problem I have is the number of records displayed on each page are as follows;
Page 1: 1
Page 2: 2
Page 3: 3
Page 4: 2
Page 5: 1
So, the question is, am I using the :item until and :item from correctly in the right order in the same statement? I’ve been on this for hours today and it is really frustrating! I am sure I have been staring at this so long, and tried so many different things that I cannot see the wood for the trees now.