2 Replies Latest reply: Apr 22, 2017 3:14 AM by Erik Wetterberg RSS

    Extension to Auto Launch Mashup from Hub

    Bill Markham

      Hi

       

      I have knocked up a rough & ready extension to auto open a url, for the use case of being able to auto open a Mashup from the Hub - see attached.

       

      There is a console.log in it displaying layout.myproperties from which one can see the counter bmCounter being incremented 3 times.  So that implies to me that the javascript is run 3 times when the sheet containing the extension is opened.

       

      Any ideas why it is running 3 times ?

       

      Any other suggestions in general would be welcome.

       

       

      Many Thanks,      Bill

        • Re: Extension to Auto Launch Mashup from Hub
          David Maron

          Hi Bill,

           

          i also want that all users of Qliksense may access apps and mashups through the hub. Did you find a way to open a mashup from the hub?

           

          Best Regards,

          David

          • Re: Extension to Auto Launch Mashup from Hub
            Erik Wetterberg

            Hi Bill,

            I think this one would be hard to solve. Even if you can make an extension that opens a mashup, still the hub opens the App Overview, where extensions are not loaded, so it would only happen when you open a sheet.

             

            If you want a page where your users can open both apps and mashup you probably need to go the other way around: write a mashup that is capable of both opening apps in the built-in client and mashups. That should not be difficult.

             

            Another option would be to write an extension that shows a button to open a mashup. I'm sure that has been done.

             

            The fact that your extension runs three times looks strange. I have tried to things, but none of them worked:

            • adding an empty resize function to the extension, since the default implementation of resize is to call paint. No effect: these are not resize calls
            • removing the update of the layout structure(moved the counter to a variable instead) in the paint method: you are not supposed to do that, the layout structure is in principle read-only and your changes might be lost when the object is reevaluated: no effect, still three calls

            To me this (the three calls) looks like a bug, though I don't think Qlik promises anything about the number of times paint will be called (only that it will be called when a repaint is needed).

             

            Erik