Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

jason_robertson
New Contributor II

Qlik Sense API Objects and Destroying

We have upgraded from QlikSense 3.1 to QlikSense June 2017 Patch 1 in our dev environment and one of the extensions we use is now failing in the newer version.  We are using a Show/Hide extension (GitHub - fadyheiba/ShowHide: This Qlik Sense extension is a container that shows or hides visualizat...) to toggle between showing two different charts on a sheet based on a drop down selection. The gist of what happens is for the currently selected chart the command

$scope.app.getObject($element.find('div'), $scope.currentChart) is used. 

When the toggle is used to select a different chart the following code is executed to destroy the currently created chart.

function destroyObject() {

  return $scope.app.destroySessionObject($scope.currentChartModel.layout.qInfo.qId)

    .then(function() {return $scope.currentChartModel.close();})

    .then(function() {$scope.currentChartModel = null;});

};


The getObject api is then called again with the correct id to get the new chart based on what was selected.  The problem begins when we try to toggle back to a chart that has already been displayed. An exception is thrown when the internal engine tries to set the layout for the control to display.


TypeError: Cannot read property 'qType' of undefined

    at Object.f.setLayout (/resources/assets/client/client.js??1499952235400:69)

    at a.c [as fn] (/resources/assets/client/client.js??1499952235400:69)

This is happening because the getLayout call (in the qlik js code) does not return the correct data. (Basically returns nothing).


If I take the destroySessionObject call out everything appears to work as expected.

I have also converted the code to use the visualization api instead. Using the close method of the QVisualization in place of the destroySessionObject and the app.visualization.get in place of getObject() and I see the same behavior.


So is the call to destroy or close necessary?  (I cannot find any qlik documents stating you should always do this.)

Does this sound like a potential bug in the new version or is this extension not doing things correctly? (I am new to qlik development)

(There is also an example qvf at the above github address that will demonstrate the same behavior. The ShowHide: Buttoms sheet is a good example)


Any help would be greatly appreciated.


Thanks.



1 Solution

Accepted Solutions
jason_robertson
New Contributor II

Re: Qlik Sense API Objects and Destroying

Qlik Sense September 2017 Patch #1 has corrected the issue.

Thanks to Qlik Support for their continued effort.

8 Replies
nferna001
New Contributor II

Re: Qlik Sense API Objects and Destroying

I would actually like some feedback from Qlik, as i'm having the same problem. Why is this question unanswered almost a month and a half after?

jason_robertson
New Contributor II

Re: Qlik Sense API Objects and Destroying

I ended up opening a support ticket with Qlik and it is a bug.

A fix was supposed to have dropped yesterday in the Qlik September 2017 release.

I should be able to test in our dev environment shortly.

nferna001
New Contributor II

Re: Qlik Sense API Objects and Destroying

Thank you for the response. I'll update and check. I'll open another thread if something fails

xavier_jordioll
New Contributor

Re: Qlik Sense API Objects and Destroying

Hi Jason,

I'm experiencing the same issue. Was your problem solved with the new release?

Thanks,

Xavi

jason_robertson
New Contributor II

Re: Qlik Sense API Objects and Destroying

Unfortunately no.  I am waiting to hear back from Qlik support for an explanation.

jaisoni_trp
Contributor II

Re: Qlik Sense API Objects and Destroying

We also have same issue and waiting for Qlik to respond.

jason_robertson
New Contributor II

Re: Qlik Sense API Objects and Destroying

Still an issue.  They have another bug QLIK-81736 that is supposed to resolve the destroy issue which should hopefully resolve this issue as well.

This is supposed to drop in Patch 1 for the Sept 2017 release. 

Will update the thread when I see this update drop and test.

jason_robertson
New Contributor II

Re: Qlik Sense API Objects and Destroying

Qlik Sense September 2017 Patch #1 has corrected the issue.

Thanks to Qlik Support for their continued effort.

Community Browser