Hi,

The DataRequest object (req) is used for batch operations. In the
above code, you are adding 2 requests, one for fetching the viewer
details, and the other for fetching the viewer's friends. You add a
key to each of the requests ("viewer" and "viewerFriends"), so you can
retrieve the data later from the response using these keys. A more
complete example would be as follows. Note how the data is retrieved
in the callback, using the key name and data.get().

var req = opensocial.newDataRequest();

req.add(req.newFetchPersonRequest("VIEWER"), "viewer");
req.add(req.newFetchPeopleRequest("VIEWER_FRIENDS"), "viewerfriends");
req.send(onGotViewer);

function onGotViewer(data)
{
        var viewer = data.get("viewer").getData();
        var viewerfriends = data.get("viewerfriends").getData().asArray();
...
}

Let me know if you need more help.

Thanks,
Anash


The response of the DataRequest operation

On Jul 8, 1:58 am, isolated <[EMAIL PROTECTED]> wrote:
>   req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
>   req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS'),
> 'viewerFriends');
>
> What this code will actually do, Please reply in depth
> Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to