Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

alexander_johr
New Contributor

Mashup Objects not closable - huge performance issue

Hello,

I'm developing a Singe Page Application Mashup with lot's ob Sense Objects in it. I link the objects with the app.GetObject function.

When navigating through the Mashup it becomes slower and slower until it gets unusable. I profiled a bit and found out, that with the increasing count of registered objects, the count of watchers and the time for the digest cycle increases.

But I can't unregister the objects. Before I updated to Qlik Sense 3, there was that "close" function on the object model which is delivered by the promise of the GetObject function. However, I didn't notice, that this close function didn't change anything. Now that I have Qlik Sense 3, the close function is gone completely.

I also tried the following functions, because I thought it may help, but they didn't:

app.destroySenseObject(objectId)

object.destroyAllChildren
object.removeAllListeners
object.markAsCancelled

Please help!

Best Regards

Alex

Tags (2)
3 Replies
Employee
Employee

Re: Mashup Objects not closable - huge performance issue

Hi alexander.johr‌,

One common way to do it is by storing the visualization models in an object and close them when needed:

var vizObjects = {};

function clean(){

     for(var vizId in vizObjects){

          vizObjects[vizId].close();

     }

}

[...]

app.getObject("QV01", "xyz"),then(function(model){

     vizObjects["xyz"] = model;

});

[...]

app.getObject("QV99", "abc"),then(function(model){

     vizObjects["abd"] = model;

});

//somewhere else under another route

clean();

... anyway something like that.

Unfortunately I couldn't found any example, maybe it's time to write one.

I hope this helps

alexander_johr
New Contributor

Re: Mashup Objects not closable - huge performance issue

That's exactly what I do (or rather did) and what my question addresses.

But the close method was removed and now I get the error: TypeError: obj.close is not a function.

I'm using Qlik Sense Desktop 3.2 SR3. For version 2.x it worked fine.

Employee
Employee

Re: Mashup Objects not closable - huge performance issue

This looks like a bug, I will need to investigate

Community Browser