Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, i'm triyn' to develop a mashup that takes chart from 2 different Qlik Sense apps. i get the app object using the Root API method qlik.currApp().
I saw currApp() can take a parameter reference but i'm not able to use this in the correct way.
Can anyone give me some help?!
Thanks a lot and have a good day.
Ale
Hi,
You are not using qlik.currApp() in an extension, so `this` in your context is the function itself, the logic behind .currApp method will fallback by getting the first opened app - that can be random
For that to work, you need to send qlik.currApp({app.qlikApp}), but even in this case, I still recommend you to use qlik.openApp - and you don't have to worry about opening multiple websockets -- once an app is opened, when running qlik.openApp the second time, it will return the cached app.
I hope this helps
The problem is that in some cases, currApp() takes the reference of a wrong app!!
Hi @BU ,
You probably shouldn't use qlik.currApp() in a mashup, always use qlik.openApp() instead.
If you are talking about a 3rd party visualization (extension) that uses qlik.currApp() and is rendered in a mashup - then always try to use qlik-currApp(this) <- this is the reference of the extensions object, it contains the app model, so it doesn't get confused about which app is current app.
I hope this helps
/aiham
Hi @Aiham_Azmeh , thank you for your answer!! I try to be clearly.
In order to create a mashup with 2 linked Qlik Sense Apps, i wrote a config js file that take in input a variable (appId) and create a link with the related app. (code below)
The getApp() method is implementd in a qCapability js and is used to open apps
At the end, Into the views controller (i use MVC pattern to develop) i have this LOC
used to get the app reference and manage page objects.
What i need is a way to pass an app object to the currApp() method (if it's possible) and have in all parts of my code, the right reference to the right app!!
i hope i was clear.
Thank
Alex
Hi,
You are not using qlik.currApp() in an extension, so `this` in your context is the function itself, the logic behind .currApp method will fallback by getting the first opened app - that can be random
For that to work, you need to send qlik.currApp({app.qlikApp}), but even in this case, I still recommend you to use qlik.openApp - and you don't have to worry about opening multiple websockets -- once an app is opened, when running qlik.openApp the second time, it will return the cached app.
I hope this helps
Thank you so much @Aiham_Azmeh !!
I was worried about memory impact but it seems to work quite well!!
AB