Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
BU
Partner - Contributor III
Partner - Contributor III

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

Labels (4)
1 Solution

Accepted Solutions
Aiham_Azmeh
Employee
Employee

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
BU
Partner - Contributor III
Partner - Contributor III
Author

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

Aiham_Azmeh
Employee
Employee

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

BU
Partner - Contributor III
Partner - Contributor III
Author

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)

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   

Aiham_Azmeh
Employee
Employee

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

BU
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much @Aiham_Azmeh !!

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

 

AB