4 Replies Latest reply: Feb 28, 2018 2:28 PM by Fei Xu RSS

    How to reload another Sense app using widget?

    Fei Xu

      We can build a widget like this to reload the current Sense app:

       

        <lui-button ng-click="app.doReload(); app.doSave();">Reload</lui-button>

       

      However how can I reload another application? The reload API doesn't have the option to indicate other app's name or ID?

       

      qlik.app.doReload(qMode, qPartial, qDebug)

       

      Can anyone shed any light please?

       

      Cheers

       

      Fei

        • Re: How to reload another Sense app using widget?
          Erik Wetterberg

          Hi,

          You will need to call the Repository API app reload method.

           

          But I'm not sure that this is possible from a widget, you might be better off with an extension.

           

          Hope this helps

           

          Erik Wetterberg

            • Re: How to reload another Sense app using widget?
              Fei Xu

              Thank you very much for your reply.

              The help page says app api is working with widget but I don't know how to use it. Can you help me with my widget codes? It doesn't work (all I want to do is set up a reload button to load app id 95c2adae-dfa8-4a5c-9524-118b5cf328d6):

               

              <html>

              <script>


              var config = {
                  host: "mydomain.com", //the address of your Qlik Engine Instance
                  prefix: "/", //the virtual proxy to be used. for example "/anonymous/"
                  port: window.location.port, //the port to be used if different from the current port 
                  isSecure: true //should be true if connecting over HTTPS
              };

              require.config({
                  baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources",
                });

              require(['js/qlik'], function(qlik) {
                  //if there's any error we catch it here
                  qlik.setOnError( function ( error ) {
                      console.log(error);
                  });
              });


              var app = qlik.openApp("95c2adae-dfa8-4a5c-9524-118b5cf328d6", config);

               

              </script>

               

               

              <p>
                <lui-button ng-click="app.doReload();
                 app.doSave();">Reload</lui-button>
              </p>

               

              </html>