4 Replies Latest reply on Dec 17, 2013 12:03 PM by Scott A Johnson

    Is it possible to build the url of an App's view programmatically?

    Scott A Johnson

      I would like to get the url of a view in my app to pass in as a "callback" url in an iframe. I see the function gadgets.views.requestNavigateTo, but don't see anything such as gadgets.views.buildURL.

       

      Is this possible? Am I looking in the wrong place?

       

      Thanks,

      Scott

        • Re: Is it possible to build the url of an App's view programmatically?

          If I am understanding you correctly, you want to take your view and push it through a standard iFrame.  That's not going to very easy, as all the views run through OpenSocial for rendering and initialization.  While it is possible to maybe copy the exact URL from an iframe and leverage it elsewhere, pretty sure that success would be limited at best.  I haven't tried this before, but can definitely say that it's not the type of use that OpenSocial or Jive supports/promotes.  Hope that helps.

            • Re: Is it possible to build the url of an App's view programmatically?
              Scott A Johnson

              Yeah I can see that. After playing around a bit more I see that the urls are built like: http://hostname/gadgets/ifr?url={url of app.xml}&...&view={name of view to render}&...

               

              I presume this url is built in Jive, not front end?

               

              Basically my usecase is: The embedded view contains an iframe which handles the embed workflow and passes resulting values into a returnUrl defined when opening the iframe. Those values need to then be used to render an embedded artifact.

               

              Since, based on OpenSocial embedded experiences docs, it seems that I need to return html to be embedded to the closeApp method.

               

              My approach was to gather the values which were passed to the returnUrl, massage into html and pass through to closeApp from the page defined by returnUrl. This returnUrl needs to be included as part of the App obviously and I presume needs to be defined as a view/sub-view. Therein lies the need to build the url of a view programmatically.

               

              If you have any other ideas of how this might be accomplished, I'm all ears! How did you resolve your issue before?