Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

pablolabbe
Valued Contributor II

Variable OnChange trigger not working (v11 sr1 & sr2)

Hi All,

  I'm having an issue when trying to fire an OnChange trigger. I've created a button with a "Set Variable" Action. When I click on the button, the variable is set but the onchange trigger isn´t fired.  If I set the variable via input box, then it works .

  This behavior applies to Ajax interface . Tests were done in desktop version 11 sr1 and sr2 (webview) and server version 11 sr1 (ajax client). 

   When using plug-in, no errors was found.

Anyone have the same problem ?

Best Regards,

Pablo Labbe

Qlikview Consultant

www.visiongi.com.br

6 Replies
Not applicable

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

Hello Pablo,

Did you find any work around for this ? Even I am facing one such issue.

Thanks

pablolabbe
Valued Contributor II

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

Support told me that feature isn´t supported in Ajax Client. 

Qlikview Reference Manual (page 895 , V11 sr2) talks about this limitations on the use of macros, but I think it extends to actions too :

82 Using Macros in QV Documents on the

QV-Server

....

82.3 Macro trigger limitations

The following triggers will work as usual in the QlikView Server environment for all clients, except AJAX

mode which doesn't support event triggers:

Document.OnAnySelect

Field.OnSelect

Field.OnChange

Field.OnUnlock

Document.OnPressMacroButton

Variable.OnChange

Variable.OnInput

Best Regards,

Pablo

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

Interesting. I had not interpreted that text as meaning Ajax does not support triggers, but I suppose it could be read that way. Problem is, those triggers do seem to work when triggered by a user action and I'll bet there is a lot of code in production now that expects them to work.

The problem you are having is that an event that was was caused by an action does not cascade. That is, a SetVariable action does not trigger an OnChange in the target variable. I though it had always been that way, although I'm surprised that it works in one client and not another. I thought it more of a design issue, in that triggers fired by actions could result in an endless loop.

Contrast that with user typing input into an Input Box.That fires the OnChange for that variable in all clients, which is what I would expect.

So...to complicate the subject, my opinion is that variables set by button actions should not fire triggers. And that it's the desktop and IE Plugin clients that are broken.

-Rob

pablolabbe
Valued Contributor II

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

Rob,

   Thanks for your answer.  It appears to be a mismatch behavior between clients. Very strange.

    Anyway to attend customer requirement I implemented the solution using the IE Plugin. Hope my solution not be based on a design issue.

   Maybe anyone from Qliktech Support could answer this ?

-Pablo

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

Pablo,

I'm glad you have a solution for the moment.

On further reflection, I think it would make sense if triggers were fired by any user initiated event --  like a button click. I don't think triggers should fire when the action was fired by a trigger, that's where the cascading loop problem would come about.

-Rob

Re: Variable OnChange trigger not working (v11 sr1 & sr2)

I've had the same problem, I've contacted Qlikview support that answered me (you can search information lokking for alexandros17 - my username). Qlik told me that for security reasons events are not triggered by a button (only in Ajax, with plugin it works fine).

I worked around the problem moving logic from events of the pagr to events of buttons.

Community Browser