Hi.. I am trying to format the list of friends which I have fetched using the orkut API. I am trying to get the total number of friends (friend count) so that I can loop it and arrange the friends (3-4 friends in one row). I tried using getTotalSize() but it is not working. Can you please suggest me how to do it. I am pasting the code below.
Thanks so much ******************************************************************************* _IG_RegisterOnloadHandler(request); function request() { var req = opensocial.newDataRequest(); var opt_params = { }; opt_params[opensocial.DataRequest.PeopleRequestFields.MAX] = 9999; opt_params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [ opensocial.Person.Field.PROFILE_URL ]; req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER, opt_params), "viewer"); req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.VIEWER_FRIENDS, opt_params), "viewer_friends"); req.send(response); } function response(data) { var viewer = data.get("viewer").getData(); var name = viewer.getDisplayName(); var thumb = viewer.getField(opensocial.Person.Field.THUMBNAIL_URL); var profile = viewer.getField(opensocial.Person.Field.PROFILE_URL); var html = '<a href="' + profile + '" target="_top">' + name + '</a><br><img src="' + thumb + '"/>'; html += '<hr>'; var viewer_friends = data.get("viewer_friends").getData(); viewer_friends.each(function(person) { var thumb = person.getField(opensocial.Person.Field.THUMBNAIL_URL); var profile = person.getField(opensocial.Person.Field.PROFILE_URL); html += '<a href="' + profile + '" target="_top" style="float:left">' + '<img src="' + thumb + '" class="friendspic"/>' + '</a>'; html+= '<br/>' + person.getDisplayName(); }); document.getElementById('main').innerHTML = html; } ******************************************************************************* --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---