<?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>article Extension. Prevent multiple response from GetQvObject method in Qlik Learning Documents</title>
    <link>https://community.qlik.com/t5/Qlik-Learning-Documents/Extension-Prevent-multiple-response-from-GetQvObject-method/ta-p/1494059</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This material will show how to avoid strange issue of qva.GetQvObject method.&lt;/P&gt;&lt;P&gt;The issue is response from this method's callback is repeated multiple times.&lt;/P&gt;&lt;P&gt;Honestly I don't know why it's happening, but I know how to struggle with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's take a look at simple instance. We have an extension that should create a rabbit each time we press the button "Rabbit!".&lt;/P&gt;&lt;P&gt;After three hits we want to get something like this:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207285" alt="rabbit1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207285_rabbit1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;We use &lt;SPAN style="font-size: 13.3333px;"&gt;qva.GetQvObject method for getting a value from TextBox text with "var_tb" ID&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207286" alt="rabbit2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/207286_rabbit2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;If we don't use special preventing condition our result after three hits will be:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207287" alt="rabbit3.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/207287_rabbit3.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;This is definitely not what we want. After few more clicks we will have a plenty of rabbits.&lt;/P&gt;&lt;P&gt;All you need to do is to add an extra IF-condition which will prevent of using callback function if true:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207288" alt="rabbit4.png" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/207288_rabbit4.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;That's all. "stop_multi" will be increased each time method is passed so when we get value of it greater that zero callback will be prevented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will help you with improved development &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Jul 2018 14:16:37 GMT</pubDate>
    <dc:creator>Sergey_Shuklin</dc:creator>
    <dc:date>2018-07-08T14:16:37Z</dc:date>
    <item>
      <title>Extension. Prevent multiple response from GetQvObject method</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Documents/Extension-Prevent-multiple-response-from-GetQvObject-method/ta-p/1494059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This material will show how to avoid strange issue of qva.GetQvObject method.&lt;/P&gt;&lt;P&gt;The issue is response from this method's callback is repeated multiple times.&lt;/P&gt;&lt;P&gt;Honestly I don't know why it's happening, but I know how to struggle with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's take a look at simple instance. We have an extension that should create a rabbit each time we press the button "Rabbit!".&lt;/P&gt;&lt;P&gt;After three hits we want to get something like this:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207285" alt="rabbit1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207285_rabbit1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;We use &lt;SPAN style="font-size: 13.3333px;"&gt;qva.GetQvObject method for getting a value from TextBox text with "var_tb" ID&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207286" alt="rabbit2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/207286_rabbit2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;If we don't use special preventing condition our result after three hits will be:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207287" alt="rabbit3.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/207287_rabbit3.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;This is definitely not what we want. After few more clicks we will have a plenty of rabbits.&lt;/P&gt;&lt;P&gt;All you need to do is to add an extra IF-condition which will prevent of using callback function if true:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207288" alt="rabbit4.png" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/207288_rabbit4.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;That's all. "stop_multi" will be increased each time method is passed so when we get value of it greater that zero callback will be prevented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it will help you with improved development &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2018 14:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Documents/Extension-Prevent-multiple-response-from-GetQvObject-method/ta-p/1494059</guid>
      <dc:creator>Sergey_Shuklin</dc:creator>
      <dc:date>2018-07-08T14:16:37Z</dc:date>
    </item>
  </channel>
</rss>

