Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Andrea_Ghirardello

How to GetCurrentSelections in an extension object?

Hi everyone,

I'm trying to retrieve the current selections in my extension.

I tried the example from QlikView Ajax JavaScript Library but when I select more than 6 values, I get a result in the form "x of y".

Could anyone please help me? Is there a method like the GetFieldSelections in desktop API?

Andrea

13 Replies
patrik_seger
Partner - Creator
Partner - Creator

Hi

Lets try this then (inspired by Steoel above)...

Define an "invisible" text property in the Define.xml file:

    <Text Expression="=GetCurrentSelections('',':',',',100)"/>

Make it invisible by not supplying any code for this Text input in the .qvpp file.

Then, in JavaScript, read the value of the corresponding text field:

    currentSelections = this.Layout.Text##.text;

where ## is the corresponding text number (0 for the first Text in the Definition.xml, 1 for the next and so on).

I use this technique to get the current QlikView version (<Text Expression="=QlikViewVersion()"/>) and it works fine, so this should probably work as well.

Br Patrik

Andrea_Ghirardello
Author

Thanks....we had come to the same conclusion.

Clever_Anjos
Employee
Employee

andrewpettit
Partner - Creator
Partner - Creator

Do you know of any limitations on this method? I tried using an expression I need as a property but I get an error. If I use the expression "=today()" it works just fine. However my expression does not work. To validate things the expression I am trying to use works fine in a textbox and if I unhide the property I still cannot set the default to my expression and things work, but I can paste it in via the properties dialog and everything works after.

So I can get my extension to work properly but I cannot default the one property to the required value and hide it without error.