PagedDataListSource's pageIndex starts with 1

Oct 22, 2012 at 5:06 AM

Folks,

Why are PagedDataListSource's calls that use pageIndex 1-based instead of 0-based?  There's quite a few adds/subtracts both in Okra and my code as a result -- and it seems more likely for a bug to creep in.

Any idea why this is done?

thanks,

--randy

 

Coordinator
Oct 22, 2012 at 1:16 PM

Hi,

The main use-case for the PageDataListSource when I was designing it was for retrieving page based data from web APIs (Flickr, etc.). In general these refer to the first page as page 1, therefore I decided to stick to the 1-based page index. Obviously if you are using a case with a 0-based paged index it complicates things, and I have been caught out before in my own apps.

Hope you can see where I was coming from for this one,

    Andy

Oct 23, 2012 at 4:50 PM

Yup, I can see the logic there -- that's honestly what I was figuring it was.

I can see that you've got a note about PagedDataList not supporting a new count coming back on a get-data request.  I've done some work to support that -- once I'm sure that works, do you want the patches?

Thanks!

Coordinator
Oct 23, 2012 at 6:02 PM

If you've got code you want to send along that would be great. It's always good to see how other people approach things.

Andy