Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jcamps
Partner - Creator
Partner - Creator

Variables, Triggers and the Back button

Hi,

In my QVW, I'm using a trigger event to change the value of a variable when the selection changes. So, when I make a selection, the event triggers and the variable changes. So far, so good. My problem is with the back button: the first time I click on BACK the variable rolls back, and I need a second "Back" click to undo the original variable. This is not acceptable since the variable value is related to the selection, and a single "back" leaves an incorrect state.

A simple attached xample might help:

     - field MYFIELD, values 1,2,3

     - variable MYVAR

     - Objects: MYFIELD Listbox, and MYVAR Textbox.

There is a ONSELECT trigger on Myfield, that sets MyVar as "=10*Myfield".

First, select "1" on MyField. the event triggers and sets the MyVar as 10*1... so the TextBox displays "10".

Repeat with "2", same logic and the TextBox displays "20".

So far, so good.

BUT, if I click "back", the VAR is rolled back to "10" BUT NOT the Field. This results in having on-screen the value "2" still selected, but the textbox displays "10"..... obviously, not 10 times the selected value

I dont know how to avoid the "variable change" being inserted in the "back pile". Any other workaround would be also apreciated.

Note that I know i could set MyVar directly as an expression so that it evaluates automatically, without a trigger. The problem is, this formula is very complex, and the same value is used over 50 times in a single sheet. For some reason QV does not cache the result, so it is evaluated 20 times in a single tab making the sheet unusable.

12 Replies
jcamps
Partner - Creator
Partner - Creator
Author

No ideas? No way to change a variable's value without having it added to the "back queue"?

I thought I might try setting an inputfield instead, I have never done this and I don't know if it will have other issues (I need it running locally, and server-side both Plugin and AJAX...)

If anyone has any better ideas or have faced similar problems, please let me know, otherwise I'll let you know how the inputfield idea works...

jeremy_fourman
Creator
Creator

Hi, this issue is affecting me as well the following link has it cofirmed as a bug. I am trying to track down if this has been fixed.

http://community.qlik.com/thread/14259

Anonymous
Not applicable

Has anyone found a work around for this issue?  I need to be able to skip the variable changes in the back button.

Thanks,

JS

Not applicable

Too bad there seems to be no fix for this.  I was using this handy trick for date ranges.  I love how it will enter in the max and min dates based up your selections so I moved the functions from the particular date fields to the OnAnySelect document event trigger (External --> Set Variable) to manipulate vStartDate and vEndDate.  No matter what they select they will see the min and max date for their selection.

Imagine my dismay that the Back button now takes a two-clicks.  This is going to be a tough call as to which functionality my users will be happier with.

Not applicable

Did you solve this?   I am using a field trigger to set 1 field = another.  The BACK button changes the second field but not the first.  I can't get a custom back button to work right either.  

Not applicable

Hi,

Does anyone know what going on with that bug?

omerfaruk
Creator
Creator

Has anyone checked whether this has been resolved in the (available) QV12 version ?

jcamps
Partner - Creator
Partner - Creator
Author

I haven't checked, but I bet it hasn't, see resolution for this:

Resolution

This was reviewed by R&D with ID 41442 and is closed as working as designed.
The reason for this is that the current behavior (QV10 and QV11) is that the Back operation goes back one step from previously applied action.
This includes all actions even variables.
omerfaruk
Creator
Creator

to R&D who close the ticket for that reason,

Nothing wrong with the idea of allowing users go back one step backward from previously applied action (Though never needed this and really wonder if anyone needed..). However, allowing users to go back one step from previously applied "selection" is definitely the thing end users are more interested in. Because end users are not interested in the variables changing at the back end but interested in the selections they made on the document.