Hi Zach,
 
first of all you forgot to add the params variable to your request.
req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER,params),'owner');
you can get the ID of the person just by owner.getId()To know more on what 
fields you have access to check out 
http://docs.google.com/Present?docid=dd5dv8xk_11dz8824x7
Thanks ~Aakash
http://aakash-bapna.blogspot.com 



> Date: Thu, 19 Jun 2008 05:58:32 -0700> Subject: [OpenSocial] Null fields> 
> From: [EMAIL PROTECTED]> To: [email protected]> > > Wondering 
> if anybody might be able to show me where I'm screwing up> here. Everything I 
> get back using getField() is either null or> undefined. The only thing that 
> seems to work is getDisplayName().> > 
> gadgets.util.registerOnLoadHandler(init);> > function loadFriends() {> > var 
> req = opensocial.newDataRequest();> var params = {};> 
> params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]=> 
> [opensocial.Person.Field.ID,> opensocial.Person.Field.NAME,> 
> opensocial.Person.Field.GENDER,> opensocial.Person.Field.REGION];> > > > 
> req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER),> 
> 'owner');> > > 
> req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.OWNER_FRIENDS,>
>  params), 'ownerFriends');> req.send(onLoadFriends);> > }> > function 
> onLoadFriends(data) {> > var owner = data.get('owner').getData();> var 
> ownerFriends = data.get('ownerFriends').getData();> var content = 
> document.getElementById('content');> var username = 
> document.createElement('div');> var userbody = 
> document.createElement('div');> var userleft = 
> document.createElement('div');> var userright = 
> document.createElement('div');> var name = owner.getField( 
> opensocial.Person.Field.NAME );> alert(name);> > 
> username.setAttribute("class", "username");> 
> username.setAttribute("className", "username");> 
> userbody.setAttribute("class", "userbody");> 
> userbody.setAttribute("className", "userbody");> 
> userleft.setAttribute("class", "userleft");> 
> userleft.setAttribute("className", "userleft");> 
> userright.setAttribute("class", "userright");> 
> userright.setAttribute("className", "userright");> > username.innerHTML = 
> owner.getDisplayName() + "<hr>";> > userleft.innerHTML = 
> "<b>Name:<br>Location:<br>Email:<br><br>General> Info:<br></b>";> 
> userright.innerHTML = owner.getField(opensocial.Person.Field.NAME) +> 
> "<br>";> > alert(owner.getField(opensocial.Person.Field.ID));> alert("Name: " 
> + owner.getField(opensocial.Person.Field.NAME));> 
> alert(owner.getField(opensocial.Person.Field.ABOUT_ME));> > 
> userbody.appendChild(userleft);> userbody.appendChild(userright);> 
> content.appendChild(username);> content.appendChild(userbody);> > }> > 
> function init() {> loadFriends();> }> > Fairly bumfuzzled,> -Zach> 
> _________________________________________________________________
Introducing Live Search cashback .  It's search that pays you back!
http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=introsrchcashback
--~--~---------~--~----~------------~-------~--~----~
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