|
|
||||||
|
#1
|
|
|
|
|
Anybody can explain how pagination in sharepoint caml query works? I
don't understand the few examples there is on the internet. Thanks. |
|
|
|
#2
|
|
|
|
|
Hi Cykill
When you're using the list web service method GetListItems and the result is limited by RowCount (either because you specified it in the request or due to it being in the view that's used) then the rs:data element will contain both ItemCount and ListItemCollectionPositionNext attributes like this: <rs:data ItemCount="100" ListItemCollectionPositionNext="Paged=TRUE&p_T itle=Test%20data&p_ID=304"> ... all the z:row elements </rs:data> When you want the next page you need to use the same query as before but with the ListItemCollectionPositionNext attribute in a Paging element in QueryOptions like this: <Paging ListItemCollectionPositionNext="Paged=TRUE&p_T itle=Test%20data&p_ID=304"/> You then repeat this (changing the ListItemCollectionPositionNext for each call) until you get a rs-data with only ItemCount like this: <rs:data ItemCount="31"> On Tue, 10 Mar 2009 21:56:33 -0700, cykill <cykill> wrote: |
|
#3
|
|
|
|
|
Thanks for you reply. Does the p_Title field required? I'm trying to
get it to work with Paged=TRUE&p_ID=5 to work but it keeps returning all the rows. Per Jakobsen wrote: [..] |
|
#4
|
|
|
|
|
Hi Cykill
You should NEVER hardcode or generate the ListItemCollectionPositionNext attribute yourself. It SHOULD always be take from the previous response. The presense of p_Title in my example was due to the original query being sorted by Title (but you shouldn't care how it's build). But let's step back a bit: GetListItems takes a lot of parameters: public XmlNode GetListItems (string listName, string viewName, XmlNode query, XmlNode viewFields, string rowLimit, XmlNode queryOptions, string webID) To start using paging you need a rowLimit. This can be given by specifying a view which has a row limit, but it's better to specify your paging size in the rowLimit parameter (it's a string like "25"). When you specify a rowLimit then you first request will only return that number of rows, but have the ListItemCollectionPositionNext in rs:data for use in the request for the next page. On Wed, 11 Mar 2009 15:17:48 -0700, Cykill <no> wrote: [..] |
|
|
| Similar Threads | |
| How do I use CAML to render the results of a CAML query? I've read SDK, but all I found were examples on how to customize the look & feel of sites or how to create/edit templates. I would like to utilize CAML to render the results... |
|
| Query CAML dynamic I have a format of query in CAML how I can upgrade the query to be a dynamic query, which means that the value get from control like textbox. Can you give me a reference to... |
|
| Formulae Caml Query Hi Guys, Just wondering, if these are possible. Whithin a Where caluse for a query; 1. To have values of two fields compared. e.g. <Where> <Eq> |
|
| CAML Query I have a question regarding a CAML Query using SPQuery. I'm trying to return results by querying a URL field (of type URL). I can't find much documentation on CAML and... |
|
| Caml where .. like .. query Hi I want to do a query using Caml in sharepoint that's the equivalent of SELECT * FROM some_db WHERE some_value LIKE %some_string I've trie <Where><Eq><FieldRef... |
|
|
All times are GMT. The time now is 12:10 AM. | Privacy Policy
|