Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Pascal
Contributor II
Contributor II

Qlik Sense Mashup CurrentSelections Object not working properly

Hello,

My mashup contains a navigation that allows me to switch apps(dashboards) and pages.
When i go to the mashup it opens with a default app and page. On the page i load several objects, one of them is the CurrentSelections object. It works like it should.

Then i navigate to a other app(dashboard) in the code the app will be closed and the new one will be loaded. The CurrentSelections object also works like it should.

But as soon as i go back to the first app or a other app that is already loaded once. The content in the selections isn't working/showing up anymore. (The screen with the Selections and App dimensions functionality).

Like i said above every time when i switch app it gets closed and a new connection will be created. Also all the objects and layout will be loaded again. So its fresh like i went to the app if its the first time.

Somebody has a idea why this happens, and maby has a solution?

Regards,
Pascal

Labels (5)
3 Replies
ajaykakkar93
Specialist III
Specialist III

Hi,

A new socket is. Opened when you switch your application via api

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Pascal
Contributor II
Contributor II
Author

Hi thanks for the reply, so what you mean is that when i switch by some reason the old socket still exist even when i did app.close. I will check it out asap when im back at work.

Regards,
Pascal
Pascal
Contributor II
Contributor II
Author

I took a look if it closes the old websocket this happens when i do app.close(); so that works fine.
Then it creates a new websocket when i open a new app with qlik.openApp(id); that works fine also. websocket.PNG

 


Also to give everyone some more info how the process go now a bit more details: (I know some parts i already said)

Process:
When i navigate to a other app i check if a app connection exist if it exist then i close it with app.close().
Then i connect a new app with qlik.openApp(id).
Then before i grab the new objects i close the old objects with obj.close() with a forEach loop. (This is possible because  when i grab the objects i push them into a array) 
Then i grab the new objects with app.getObject(placeholder, id) and push them into the objectArray so i can close them later.

When i navigate from the first app to the second one and even third one. As long as its a app that i open for the first time, the App dimensions are filled when i press the Selections button.(Marked with red arrow)

But when i go back to a app that i opened before the App dimensions are empty  when i press the Selections button. 
Empty with button.PNG

I readed that the current selections object works bit different then other objects.
Im happy already that i got pointed to the websocket i forgot about that but that seems to work normal.

Regards,
Pascal


Update
I remove the app.close() call and then the App dimensions seems to work like normal when i switch back to the app, but thing is wont this be a problem? since i keep a connection always open to the App.