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

Change button value, when clear all selections is clicked.

Hello,

I have a button that changes the filtering of certain fields when it is clicked. The text on the button changes from order to request on clicking and vice versa (this is achieved by creating a variable vhide and when the value is 1 it shows order).


When i click the clear all selections button the button shows the same value (order or request) . I want the button to show 'Order' each time when I press clear all selections button.


Thank You.

1 Solution

Accepted Solutions
avinashelite

Your talking about the default clear All button ? if yes then it won't re set the variables , you need to create a custom button and add the action to cleat all selections + Action to clear all the required variables

View solution in original post

13 Replies
avinashelite

Your talking about the default clear All button ? if yes then it won't re set the variables , you need to create a custom button and add the action to cleat all selections + Action to clear all the required variables

Not applicable
Author

Can i create a button that clears all variables when the clear all selection button is clicked? I would make this button invisible.

Sergey_Shuklin
Specialist
Specialist

Hi, Rahul!

Try to catch when all selections are clear with "=if(isnull(GetCurrentSelections())=-1,'Order',...".

Not applicable
Author

Is there absolutely no workaround for doing that?

CarlosAMonroy
Creator III
Creator III

Are you talking about the button name only?

It can changes if you do the following condition:

Button Name:

=if($(vVariableName=1,'Order','Request')

Action->External->Set Variable:

=if($(vVariableName=1,0,1)

Hope that helps,

Carlos

Not applicable
Author

what is this code doing? I want the button to show order , when i click clear all. Your code just changes the name of the button when it is clicked. I have already done that . I need a way to show order when clear all selection is clicked basically go back to the original variable value.

Thanks

Not applicable
Author

You can use =if(IsNull(GetCurrentSelections()),value,value) to change the value of a variable. I am just not able to do it though.

CarlosAMonroy
Creator III
Creator III

You can try this:

=if(len(GetCurrentSelections())=0,value,value)

That works perfectly.

Carlos M

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You cannot hook the Clear All button (it's a standard Windows toolbar button which doesn't even exist in the Ajax client), and in QlikView you cannot detect any triggers or messages sent by Windows objects.

As Avinash already correctly stated, you can however simulate the effect you want to obtain by duplicating the Clear All button as a regular QlikView button, adding a Clear-All action and adding a Set Variable action to resrt the label variable to a default value.