Skip to content

13.14 opensocial.data API and examples are incorrect #1343

Description

@simonhewett

The example for 13.14 has an incorrect method for getting the DataContext:

var viewer = opensocial.data.getContext().getDataSet('Viewer');
alert('Hello ' + viewer.name);
os.data.getDataContext().putDataSet('Params', {"Page": 2, "PageSize": 10});
opensocial.data.getDataContext().registerListener('Friends', function(key) {
   var el = document.getElementById('friend-details');
   el.style.display = 'show';
});

So should be updated to this:

var viewer = opensocial.data.getDataContext().getDataSet('Viewer');
alert('Hello ' + viewer.name);
opensocial.data.getDataContext().putDataSet('Params', {"Page": 2, "PageSize": 10});
opensocial.data.getDataContext().registerListener('Friends', function(key) {
   var el = document.getElementById('friend-details');
   el.style.display = 'show';
});

And the API definition for 13.14.1 is incorrect:

13.14.1 getContext 

Signature
<static> DataContext opensocial.data.getContext()

So should be updated to this:

13.14.1 getDataContext

Signature
<static> DataContext opensocial.data.getDataContext()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions