I have a very nice flash slide show widget.

In the code for the widget it take two paramters to make it work

1. Userid
2. Albumid

I am trying to create an app, where by on the home view the slideshow
album will be active. On the profile view a drop down will all the
users albums will appear. They will submit this value. Obviously the
slideshow will then show the album.

What i need help with is calling the list of albums. Here is my code
so far.

<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="Gifts part 3 - Showing Gifts">
    <Require feature="opensocial-0.8"/>
  </ModulePrefs>
  <Content type="html">
    <![CDATA[
      <script type="text/javascript">



        function callback_albums(data) {
                var userAlbums = data.get('viewerPhotoAlbumRequest').getData();

          html = new Array();
          html.push('<select id="album">');
           userAlbums.each(function(album) {

              html.push('<option value="',
album.getField(MyOpenSpace.Album.Field.ALBUM_ID), '">',
album.getField(MyOpenSpace.Album.Field.TITLE), '</option>');

          });
          html.push('</select>');
          document.getElementById('albums').innerHTML = html.join('');
        }

        function init() {
        var req = opensocial.newDataRequest();
          req.add(req.newFetchPersonRequest("VIEWER"), 'viewer');

                  var viewerAlbums = opensocial.newIdSpec({ "userId" : "VIEWER" 
});

                  var viewerPhotoAlbumRequest  =
MyOpenSpace.DataReqeust.newFetchAlbumRequest(viewerAlbums);

          req.add(viewerPhotoAlbumRequest);
          req.send(callback_albums);

        }

        gadgets.util.registerOnLoadHandler(init);
      </script>

          <form >
            <span id='albums'></span>

          </form>

    ]]>
  </Content>
</Module>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to opensocial-...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en.

Reply via email to