5 messages in com.googlegroups.opensocial-orkut[orkut-developer] Re: I am not able r...| Subject: | [orkut-developer] Re: I am not able retrieve content from this field opensocial.Person.Field.ADDRESSES![]() |
|---|---|
| From: | Peter (pete...@gmail.com) |
| Date: | 06/29/2008 09:55:03 PM |
| List: | com.googlegroups.opensocial-orkut |
Hi Jason,
Thanks for the reply,
I tried to do that way. But still getting error: This is my code
function response(data) { var viewer = data.get("viewer_profile").getData(); var aboutme = viewer.getField(opensocial.Person.Field.ABOUT_ME); output(aboutme);
var address = viewer.getField(opensocial.Person.Field.ADDRESSES); var country = address.getField(opensocial.Address.Field.COUNTRY); output(country)
};
function request() { var req = opensocial.newDataRequest();
var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.ABOUT_ME, opensocial.Person.Field.ADDRESSES ];
req.add(req.newFetchPersonRequest("VIEWER", params), "viewer_profile"); req.send(response);
};
request();
FireFox showing this error: Error: address.getField is not a function
Can you look at this?
Thanks Peter
On Jun 28, 6:14 am, Jason <apij...@google.com> wrote:
Hi Peter. viewer.getField(opensocial.Person.Field.ADDRESSES) should return an opensocial.Address object. So in order to fetch the user's country, you should be able to use:
... var address = viewer.getField(opensocial.Person.Field.ADDRESSES); var country = address.getField(opensocial.Address.Field.COUNTRY);
opensocial.Person.Field.CURRENT_LOCATION also returns an opensocial.Address object which you can use in the same way. Please let me know if this doesn't work for you.
- Jason
On Jun 27, 2:12 am, Peter <pete...@gmail.com> wrote:
Hi All,
how can I get content from opensocial.Person.Field.ADDRESSES .
I am getting output [Object Object] while using coderunner.
I can see the content by using function dumpObj.
but i tried this code: var vcountry=viewer.getField(opensocial.Person.Field.ADDRESSES).fields_.country
its returning error for me.
can any one can help on this.
Thanks Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Orkut
Developer Forum" group.
To post to this group, send email to open...@googlegroups.com
To unsubscribe from this group, send email to
open...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---




