Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Partner
Partner

qlik.currApp() with 2 different apps

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

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Re: qlik.currApp() with 2 different apps

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

View solution in original post

5 Replies
Highlighted
Partner
Partner

Re: qlik.currApp() with 2 different apps

The problem is that in some cases, currApp() takes the reference of a wrong app!!

Highlighted
Employee
Employee

Re: qlik.currApp() with 2 different apps

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

Highlighted
Partner
Partner

Re: qlik.currApp() with 2 different apps

Hi @aaz , 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)

Cattura2.PNG

 

 

 

 

 

 

 

The getApp() method is implementd in a qCapability js and is used to open apps

Cattura3.PNG 

 

 

 

 

 

 

 

 

At the end, Into the views controller (i use MVC pattern to develop) i have this LOC

 

Cattura.PNG

 

 

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   

Highlighted
Employee
Employee

Re: qlik.currApp() with 2 different apps

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

View solution in original post

Highlighted
Partner
Partner

Re: qlik.currApp() with 2 different apps

Thank you so much @aaz !!

I was worried about memory impact but it seems to work quite well!!

 

AB