Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Extension. Prevent multiple response from GetQvObject method

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Sergey_Shuklin
Specialist
Specialist

Extension. Prevent multiple response from GetQvObject method

Last Update:

Jul 8, 2018 10:16:37 AM

Updated By:

Sergey_Shuklin

Created date:

Jul 8, 2018 10:16:37 AM

Hello, Everyone!

This material will show how to avoid strange issue of qva.GetQvObject method.

The issue is response from this method's callback is repeated multiple times.

Honestly I don't know why it's happening, but I know how to struggle with it.

Let's take a look at simple instance. We have an extension that should create a rabbit each time we press the button "Rabbit!".

After three hits we want to get something like this:

rabbit1.png

We use qva.GetQvObject method for getting a value from TextBox text with "var_tb" ID:

rabbit2.png

If we don't use special preventing condition our result after three hits will be:

rabbit3.png

This is definitely not what we want. After few more clicks we will have a plenty of rabbits.

All you need to do is to add an extra IF-condition which will prevent of using callback function if true:

rabbit4.png

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.

Hope it will help you with improved development 😃

Version history
Last update:
‎2018-07-08 10:16 AM
Updated by: