Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1715

osapi calls not executed when using registerOnLoadHandler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 3.0.0
    • 2.5.0-beta2
    • Javascript
    • None

    Description

      I'm running the latest Shindig version from SVN trunk and every gadget that uses registerOnLoadHandler() for initialization runs into the same issue. Given the following JS code in the gadget the function cb(user) is never called. As can be seen with Firebug actually the osapi.people.get() call is actually never executed:

      <script>
      function cb(user) {
      console.log("i'm here");
      }

      function initData() {
      osapi.people.get(

      {userId: '@viewer'}

      ).execute(cb);
      }

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

      Steps to reproduce:
      1. Get Shindig from trunk
      2. Compile with "mvn clean install"
      3. Run jetty with "mvn -Prun"
      4. Navigate to http://localhost:8080/samplecontainer/samplecontainer.html
      5. Set the displaying gadget to "http://localhost:8080/samplecontainer/examples/SocialHelloWorld.xml"
      6. Click "reset all"

      After step 6 I expect to see the rendered list of friends but I don't see anything being rendered inside the gadget except for the "Say hello" button. Pressing it doesn't seem to trigger any API call or sth.

      Attachments

        Activity

          People

            Unassigned Unassigned
            makkes Max Jonas Werner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: