Qlik Community

Qlik Education Documents

Documents related to Qlik Education.

Extension. Prevent multiple response from GetQvObject method

Specialist
Specialist

Extension. Prevent multiple response from GetQvObject method

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
Revision #:
1 of 1
Last update:
‎2018-07-08 10:16 AM
Updated by: