Hi.

Your code is correct: you can access GENDER and other opensocial.Enum
fields using code like:

person.getField(opensocial.Person.Field.GENDER).getKey()

Your problem is likely due to the fact that the friends you are trying
to access do not have your application installed. GENDER is an
extended profile field and is only available for users that have
installed the application.

You may consider adding a HAS_APP filter to your original request to
retrieve only those friends that have the application installed.
Otherwise, you will have to make sure
person.getField(opensocial.Person.Field.GENDER) is a valid object
before calling the getKey method.

Please let me know if you have any other questions on the topic.

- Jason

On May 19, 8:31 am, Julian Andrade <[EMAIL PROTECTED]> wrote:
> can anybody plz helpme?
>
> On 15 maio, 15:49, Julian Andrade <[EMAIL PROTECTED]> wrote:
>
> > i was trying to get the gender of the person, but received a lot of
> > diferent errors. Im not sure that im using it right.
> > this is my code
>
> >         function init(){
> >           var params = {};
>
> > params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
> > [opensocial.Person.Field.GENDER];
>
> >           var req = opensocial.newDataRequest();
> >           req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS', params),
> > 'viewer_friends');
> >           req.send(showFriends);
> >         }
> >         function showFriends(data){
> >           friends = data.get('viewer_friends').getData();
> >           html = new Array();
>
> >           friends.each(function(person){
> >             html.push(person.getDisplayName());
> >             html.push(' - ');
>
> > html.push(person.getField(opensocial.Person.Field.GENDER).getKey()) ;
> >             html.push('<br>');
> >           });
>
> >           alert('');
> >           document.getElementById('content_div').innerHTML =
> > html.join('');
> >         }
--~--~---------~--~----~------------~-------~--~----~
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