This project has moved. For the latest updates, please go here.

Paged Data Requests

Jan 31, 2012 at 7:02 PM
Edited Jan 31, 2012 at 7:05 PM

The latest WP7 app I am building has a requirement to be able to call a web service that returns data in paged results.

The service returns the first set of results along with a continuation token to use in the next call to get the next page of results.

Is there a preferred way of handling this in AgFx?

I see on the documentation page there is a mention of a future drill-down "Handing paging of data" - is there a preview version of this drill-down document? :)

thanks
Michael

Coordinator
Feb 3, 2012 at 6:26 AM

Hi -

Sure.  In your load context, add a field for the continuation token.  When you deserialize, add that value into the LoadContext, then when you do the next load, in GetLoadRequest, pass it along as part of the request.

The challenge ends up being around caching and how you want that to work.  Do you want to cache the requests as being separate, e.g. so that each continuation request is treated like a different piece of data and cached separately, or do you want to cache the last value itself, or try to cache all of them.  The last one is the trickiest, the first two are pretty easy.  Basically, what behavior do you want upon startup of the app with respect to loading the data from the cache.

If you can answer that question, the pattern ends up being pretty easy.


SB