MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

newFetchPeopleRequest pagination not working

Last post 09-05-2009 6:22 PM by Brandon Black. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-04-2009 2:03 PM

    • Egg
    • Top 50 Contributor
    • Joined on 02-05-2008
    • Posts 73

    newFetchPeopleRequest pagination not working

    I'm working on an application that lets a user page through their friend list to take an action. I'm running into an issue (that wasn't there yesterday).

    function doFriends(page_num){
    	page_num = page_num - 1;
    	var req = opensocial.newDataRequest();
    	var viewer_friends_spec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" : "FRIENDS" });
    	var friend_params = {};
    	friend_params[opensocial.DataRequest.PeopleRequestFields.MAX] = 20;
    	friend_params[opensocial.DataRequest.PeopleRequestFields.FIRST] = (page_num * 20) + 1;
    	req.add(req.newFetchPeopleRequest(viewer_friends_spec, friend_params), "friends");
    	req.send(doFriendsCallback);
    }
    function doFriendsCallback(d){
    	var viewer_friends = d.get("friends");
    	friends = viewer_friends.getData();
    	// Do stuff with these records...
    }
    

    All three of these requests return only page 1 despite passing the correct values

    doFriends(1);
    doFriends(2);
    doFriends(3);
    

    I can see in the code it's looking to get the next set of data

    http://api.msappspace.com/api-v2.svc/json/people/@me/@friends?opensocial_surface=CANVAS&ts=1252097128149&startIndex=2&count=20&format=JSON&filterBy=all

    but then I get back:

    {"totalResults":58,"startIndex":1,"itemsPerPage":20,"sorted":false,"filtered":true,"entry":[{...
  • 09-05-2009 6:22 PM In reply to

    Re: newFetchPeopleRequest pagination not working

    This should be resolved for you by now. We rolled new code yesterday that cause this due the fact that startIndex is being used (incorrectly actually) as the page index. We rolled a fix for this again last night and you shouldn't be seeing this anymore. Sorry for the headache.

Page 1 of 1 (2 items)