I have the problem to retrieve the the profile url for an owner using
newfetchpersonrequest and within
as optional paramters  :

var param = {};
param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
[opensocial.Person.Field.PROFILE_URL];

but in the response function i am trying to get then the profileurl
by :

var owner = dataResponse.get('owner').getData();
var profileurl = owner.getField(opensocial.Person.Field.PROFILE_URL);


... but it doesnt work why???

marc.


On Apr 19, 5:41 pm, Rakesh <[EMAIL PROTECTED]> wrote:
> I am getting an error in newFetchPersonRequest when I pass a userId to
> the request. See code below
> I am perfectly getting the friend id in "e.id" but in call back
> function dataResponse.hadError() is true and var friend is null
> Could you explain this please?
>
> function OnClickFriend(e)
> {
> var req = opensocial.newDataRequest();
> var param = {};
> param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
> [opensocial.Person.Field.ALL];
> req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER),
> 'viewer');
>      req.add(req.newFetchPersonRequest(e.id), 'singleFriend');
>     alert(e.id);
>      req.send(OnLoadSingleFriend);  };
>
> function OnLoadSingleFriend(dataResponse)
> {
> alert("callback");
> var friend = dataResponse.get('singleFriend').getData();
>      alert(dataResponse.hadError());
> alert(friend);
> document.getElementById('friendDetails').innerHTML =
> friend.getDisplayName();
>
> }
>
> On Apr 18, 9:10 am, "Meenu gupta" <[EMAIL PROTECTED]> wrote:
>
> > Rakesh,
>
> > You can use following for fetching first 20 records of friends-
> > params[opensocial.DataRequest.PeopleRequestFields.FIRST] = 20;
>
> > On Fri, Apr 18, 2008 at 9:36 AM, Rakesh <[EMAIL PROTECTED]> wrote:
>
> > > Thanks Grigolon... That works just fine...
> > > Regarding FetchPeopleRequest, does the APIs provide some way to fetch
> > > the records a few at a time rather than fetching all in one go?
>
> > > On Apr 17, 6:19 pm, Grigolon <[EMAIL PROTECTED]> wrote:
> > > > Rakesh, let's work first with the PROFILE_URL field.
> > > > First you have to create a param to add a request for PROFILE_URL,
> > > > like this:
>
> > > > var param = {};
> > > > param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
> > > > [opensocial.Person.Field.PROFILE_URL];
>
> > > > Then you use:
>
> > > req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.VIEWER_FRIEN­­DS,
> > > > param),
> > > > 'viewerFriends');
>
> > > > Now, to return all friends, you have to change the MAX filter param.
> > > > Use this:
>
> > > > var param = {};
> > > > param[opensocial.DataRequest.PeopleRequestFields.MAX] = 900;
>
> > > > Now you can use both param to create your request:
>
> > > > var param = {};
> > > > param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
> > > > [opensocial.Person.Field.PROFILE_URL]; // return the correct links for
> > > > profile url
> > > > param[opensocial.DataRequest.PeopleRequestFields.MAX] = 900; // set a
> > > > new value to MAX filter (default is 20)
>
> > > > If you have any more questions, please let me know.
>
> > > > On Apr 17, 8:16 am, "rana das" <[EMAIL PROTECTED]> wrote:
>
> > > > > ve u worked on shinding container ?
> > > > > and i am trying to access my profile only .......
> > > > > but i am not getting the way ........
> > > > > can u help me out......
>
> > > > > regards,
> > > > > rana
>
> > > > > On Thu, Apr 17, 2008 at 4:34 PM, Rakesh <[EMAIL PROTECTED]> wrote:
>
> > > > > > I am working on Orkut... May be other fields are not supported.
>
> > > > > > Got any clue why only a few friends are returned in
> > > > > > newFetchPeopleRequest?
>
> > > > > > On Apr 17, 3:58 pm, "Meenu gupta" <[EMAIL PROTECTED]> wrote:
> > > > > > > Actually all fields are not supported by all containers.
>
> > > > > > > On Thu, Apr 17, 2008 at 4:25 PM, Rakesh <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > > > > > This works fine... But what about the other fields listed out in
> > > API
> > > > > > > > documentation? Even the PROFILE_URL returns null.
>
> > > > > > > > Another problem I am facing is, when I do
>
> > > req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.VIEWER_FRIEN­­­DS),
> > > > > > > > 'viewerFriends');
>
> > > > > > > > it returns me a list of only 20 friends in the callback function
> > > while
> > > > > > > > I have more than 150 friends in my friendlist. How do I get the
> > > > > > > > complete list of friends?
>
> > > > > > > > On Apr 17, 3:33 pm, mini <[EMAIL PROTECTED]> wrote:
> > > > > > > > > Hello Rakesh,
>
> > > > > > > > > Use following-
>
> > > > > > > > > viewer.getField(opensocial.Person.Field.THUMBNAIL_URL);
>
> > > > > > > > > On Apr 17, 3:14 pm, Rakesh <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > Person.getField always returns null for any parameter that I
> > > pass
> > > > > > to
> > > > > > > > > > the method. Could someone reason it out please?- Hide quoted
> > > text
> > > > > > -
>
> > > > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to