27 Replies Latest reply: Aug 23, 2016 5:51 PM by Haikuo Yu RSS

    Multipage Mashup - keep selections between html pages?

    Roland Vecera

      Hi!

       

      We have received a nice mashup that contains of multiple .html-Pages. See here: http://demo.heldendaten.net:8080/extensions/Vertriebsdemo_Sense_Mashup/Produkte.html

       

      Unfortunately, if a user does selections on one .html-Page (for example Produkt.html), these selections are lost when the user changes to another html page.

       

      From what I see in the .js code, the Mashup always calls the following  code on every new page. See below.

       

      --> to me it seems that calling openApp on every page, opens a new connection to the document --> old selections are lost.

       

      --> I have read through the mashup API, but haven't really found anything to keep the app-session alive between multiple pages. I have played wit the "identity" property of the app config, but no success (running Qlik Sense 2.0.3)

       

      --> has anyone a short example how I can fix the existing code?

       

      var config = {
           host: window.location.hostname,
           prefix: "/",
           port: window.location.port,
           isSecure: window.location.protocol === "https:"
        //,
        //identity: "12349876"
      };
      require.config( {
           baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
      } );
      
      require( ["js/qlik"], function ( qlik ) {
           qlik.setOnError( function ( error ) {
                alert( error.message );
           } );
      
           //callbacks -- inserted here --
        
           //open apps -- inserted here --
        
        
            app = qlik.openApp("871f98c2-38cd-46b1-9676-6dd3e87f06be", config);
      
           
        
           //get objects -- inserted here --
        
             $(".qvobject").each(function() {
                var qvid = $(this).data("qvid");
                app.getObject(this, qvid);
           });