<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using GetQvObject in Extensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-GetQvObject-in-Extensions/m-p/326087#M1279781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my experience there is no safe way of using what GetQvObject returns outisde the callback function. Sometime, and for some objects, it works, and other times it doesn't work.&lt;/P&gt;&lt;P&gt;The safest way to access data of a list box object is to put it inside the callback function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var LBObject;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LBObject = qva.GetQvObject("LB04",function() {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // safe access to Data here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The callback function is activated whenever the object is painted (either because it was changed/moved/resized/etc. or because another GetQvObject for it was activated).&lt;/P&gt;&lt;P&gt;The problem here is that a reference to the callback is kept by QlikView and whenever the object is painted it is called, so bear in mind that the function is not a one time callback, but it should properly handle further activations of itself.&lt;/P&gt;&lt;P&gt;What I do is to handle all situations that this list box can be in in a single callback function and then when I need to activate it manually I intiate a GetQvObject call with an empty callback (qva.GetQvObject("LB04",function() {});).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there are exceptions for this. For example I successfully access x.&lt;SPAN style="font-size: 10pt;"&gt;QvaPublic.SetVariable()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;on a global variable that holds a reference to an input box (that was populated using a call to GetQvObject).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(This is very awkward and unpleasent way of handling QlikView objects and if there is another way of doing so I would love to hear about it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Sep 2011 14:19:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-22T14:19:25Z</dc:date>
    <item>
      <title>Using GetQvObject in Extensions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-GetQvObject-in-Extensions/m-p/326086#M1279779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a very basic, simple question : &lt;/P&gt;&lt;P&gt;Can someone tell me where the best place is to define QV objects in an extension javascript file and how?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider my extension script.js file looks like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Script.js //&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Place 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qva.AddExtension('MyExtension',function() {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Place 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Script.js //&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to define my listbox objects :::&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var LBObject;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LBObject = qva.GetQvObject("LB04",function() {});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; and call it in ANY place of my code globally? like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LBObject.QvaPublic.Data.SelectTexts([1,2,3,4]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for some reason , i sometimes receive &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"LBObject.QvaPublic.Data" null or not an object javascript error when a click event occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have reviewed most of documentations about extensions but so far i couldnt find no good explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-GetQvObject-in-Extensions/m-p/326086#M1279779</guid>
      <dc:creator>niceqlik</dc:creator>
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Using GetQvObject in Extensions</title>
      <link>https://community.qlik.com/t5/QlikView/Using-GetQvObject-in-Extensions/m-p/326087#M1279781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To my experience there is no safe way of using what GetQvObject returns outisde the callback function. Sometime, and for some objects, it works, and other times it doesn't work.&lt;/P&gt;&lt;P&gt;The safest way to access data of a list box object is to put it inside the callback function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var LBObject;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LBObject = qva.GetQvObject("LB04",function() {&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // safe access to Data here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The callback function is activated whenever the object is painted (either because it was changed/moved/resized/etc. or because another GetQvObject for it was activated).&lt;/P&gt;&lt;P&gt;The problem here is that a reference to the callback is kept by QlikView and whenever the object is painted it is called, so bear in mind that the function is not a one time callback, but it should properly handle further activations of itself.&lt;/P&gt;&lt;P&gt;What I do is to handle all situations that this list box can be in in a single callback function and then when I need to activate it manually I intiate a GetQvObject call with an empty callback (qva.GetQvObject("LB04",function() {});).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there are exceptions for this. For example I successfully access x.&lt;SPAN style="font-size: 10pt;"&gt;QvaPublic.SetVariable()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;on a global variable that holds a reference to an input box (that was populated using a call to GetQvObject).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(This is very awkward and unpleasent way of handling QlikView objects and if there is another way of doing so I would love to hear about it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 14:19:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-GetQvObject-in-Extensions/m-p/326087#M1279781</guid>
      <dc:creator />
      <dc:date>2011-09-22T14:19:25Z</dc:date>
    </item>
  </channel>
</rss>

