1 Reply Latest reply on Jun 11, 2015 10:22 AM by john.boloian@nuance.com

    In !app, ctx.jive.content.id is often -1

    jlin

      I am building a !app that is Jive hosted. In Javascript, I try to make use of ctx.jive.content.id. It is often -1. Am I missing a step to getting the correct ID?

       

      if (ctx.jive.content && ctx.jive.content.type && ctx.jive.content.id) {
            alert(ctx.jive.content.id); // I will use it for context management
      }

       

      The post's URL will be:

      https://[mysite].jiveon.com/blog/update-post.jspa?ID=1013&draftID=1058

       

      And the content will show:

      ctx.jive.content.type:"osapi.jive.core.Post"

      ctx.jive.content.id:-1

       

      I don't think this happens 100% of the time, but more often than not in my app.

       

      On the view's page, I have this code:

                gadgets.util.registerOnLoadHandler(function () {

                      gadgets.window.adjustHeight();

       

                      gadgets.actions.updateAction({

                          id: "com.jivesoftware.panopto.bang", // Same action id from app.xml

                          callback: initVideoEmbed

                  });

       

      And in my JS I have this:

       

      function initVideoEmbed(ctx) {

          // Unrelated stuff...

          if (ctx.jive.content && ctx.jive.content.type && ctx.jive.content.id) {

              alert(ctx.jive.content.id); // Grab the context ID

          }

      };