web-services
  • sharepoint
  • caml
  • 2010-06-18 63 views 2 likes 
    2

    我正在使用AJAX向Sharepoint發送Web服務調用以檢索列表項。如何跳轉到GetListItems調用SharePoint任意頁面的結果?

    我得到的結果的第一頁有:

    "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \ 
         <soapenv:Body> \ 
          <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ 
           <listName>ListName</listName> \ 
           <rowLimit>10</rowLimit> \ 
           <query> \ 
            <Query> \ 
             <Where> \ 
              <IsNotNull> \ 
               <FieldRef Name='Title'/> \ 
              </IsNotNull> \ 
             </Where> \ 
             <OrderBy> \ 
              <FieldRef Name='Title' Ascending='True' /> \ 
             </OrderBy> \ 
            </Query> \ 
           </query> \ 
           <queryOptions><QueryOptions/></queryOptions> \ 
          </GetListItems> \ 
         </soapenv:Body> \ 
        </soapenv:Envelope>" 
    

    然後我就可以使用結果的書籤去到下一個頁面:

    "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \ 
         <soapenv:Body> \ 
          <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ 
           <listName>ListName</listName> \ 
           <rowLimit>10</rowLimit> \ 
           <query> \ 
            <Query> \ 
             <Where> \ 
              <IsNotNull> \ 
               <FieldRef Name='Title'/> \ 
              </IsNotNull> \ 
             </Where> \ 
             <OrderBy> \ 
              <FieldRef Name='Title' Ascending='True' /> \ 
             </OrderBy> \ 
            </Query> \ 
           </query> \ 
           <queryOptions><QueryOptions> \ 
            <Paging ListItemCollectionPositionNext='" + bookmark + "'" + " /> \ 
           </QueryOptions></queryOptions> \ 
          </GetListItems> \ 
         </soapenv:Body> \ 
        </soapenv:Envelope>" 
    

    其中書籤是「分頁= TRUE & p_Title = BlahBlah; p_ID = 5「

    但是我想跳轉到第30頁或最後一頁,所以我沒有爲p_Title設置合適的值。我試過用各種數字添加PageFirstRow變量,但它不會改變結果。如果我省略了p_Title,我只是再次獲得第一頁。更改p_ID什麼也不做。

    任何想法?

    感謝, 喬爾

    回答

    1

    documentation表明,這是不可能的。

    通過該方法 返回的XML數據包括RS內的 ListItemCollectionPositionNext 屬性:數據元素 包含的信息來支持 尋呼。該字符串包含排序中的字段的 數據和用於分頁所需的其他項的 。你 應該考慮這個字符串內部 並且不要被修改;修改它 會產生意想不到的結果。

    真的很傷心,但我猜這個屬性的名字對於它的功能是準確的。

    相關問題