Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to retrieve current selections from AJAX ZFC Document

Hi,

I am porting a .NET desktop application coded in C# to the web.

I am currently looking at a specific API: ActiveDocument.GetCurrentSelections() supported by AxQlikOCXLib.AxQlikOCX OCX component. The API returns the current active selections as key value pairs, used to achieve a certain functionality in the host .NET application.

I want to achieve the same while using AJAX ZFC client. I went through the only example (FruitColor) explaining AJAX API's in the QlikView SDK, but no luck yet.

Can anybody provide some pointers/javascript snippets on how to achieve the functionality provided by ActiveDocument.GetCurrentSelections() through AJAX ZFC client?

Thanks in advance,

Ashwin

1 Solution

Accepted Solutions
chrisbrain
Partner - Specialist II
Partner - Specialist II

The QlikView ZFC client (including the FruitColor sample) works in a slightly different way to the OCX API you are probably used to using in the .NET version of your app.

The API obviously works by calling methods on the interface when you need something back or need to update something.

With the ZFC client you register the objects in the QlikView document you are 'interested in' and then each time their state changes you get back the new data in an xml response.

It's a bit difficult to advise not knowing exactly what your app does but if you think the ZFC client can support it then you could add a text box to your QlikView application which displays the current active selections (i.e. the result of ActiveDocument.GetCurrentSelections())and then adapt the FruitColor example to use this object. You could also look at the QlikView Workbench which has a number of ASP.NET and JavaScript controls for this type of thing.

If you need to communicate with the API as in your current application then it should also be possible to do this from your web page although I don't have any sample code to post here at present.

beeido.com - BI | Software | Qlik Integration Services
GitFirst - A CI/CD solution for Qlik Sense

View solution in original post

5 Replies
chrisbrain
Partner - Specialist II
Partner - Specialist II

The QlikView ZFC client (including the FruitColor sample) works in a slightly different way to the OCX API you are probably used to using in the .NET version of your app.

The API obviously works by calling methods on the interface when you need something back or need to update something.

With the ZFC client you register the objects in the QlikView document you are 'interested in' and then each time their state changes you get back the new data in an xml response.

It's a bit difficult to advise not knowing exactly what your app does but if you think the ZFC client can support it then you could add a text box to your QlikView application which displays the current active selections (i.e. the result of ActiveDocument.GetCurrentSelections())and then adapt the FruitColor example to use this object. You could also look at the QlikView Workbench which has a number of ASP.NET and JavaScript controls for this type of thing.

If you need to communicate with the API as in your current application then it should also be possible to do this from your web page although I don't have any sample code to post here at present.

beeido.com - BI | Software | Qlik Integration Services
GitFirst - A CI/CD solution for Qlik Sense
Not applicable
Author

Registering event handlers on Objects in QlikView document might be one of the ways (need to explore this further), But I am specifically looking at a solution that can capture the current state of QlikView document on an external event, like on click of a button in the host html page.

The client Application is developed using Java/GWT, hence I need a javascript solution/API to achieve the same. Any help/pointers to similar javascript solutions will be extremely helpful.

Thanks in advance,

Ashwin

PS: Pardon my shallow knowledge of QlikView, I am just getting started.

Not applicable
Author

you can have a look at http://community.qlik.com/forums/p/19549/80264.aspx where i explained what i knew about calling standard API methods using the qvpx protocol

also, are you really interested in the value of the current selection, or do you just want to know if it is different from another selection made before ?

retrieving the key value pairs can be very time consuming when they contain a lot of values, and i guess doing it over a network should be even longer. In my project i don't need to know what the exact selection is, i just have to be notified when it changes, so I only evaluate the expression "hash128(GetCurrentSelections('', '', '', 100000))" which is really faster and compare it to the last selection hash code i got

Not applicable
Author