Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

capriconuser
New Contributor III

show/hide objects

i have 4 objects and 2 button

2 is text object and 2 is search object

now i want when i click on show/hide1 button then want to hide 2 search object and show 2 textbox and when i click on

show/hide2 button then want to hide 2 text object and show 2 search object

how i do this ?

Tags (3)
8 Replies
olivierrobin
Valued Contributor III

Re: show/hide objects

hello

you can create a variable

then on text button, create an action which sets this variable to , let's say , 1

and add conditional expressions to show search object depending on the value of the variable

benazirkhan
Contributor II

Re: show/hide objects

Hi,

In your button action: Set Variable vshow as 1 in the first button and 2 in the second button.

For the textboxes, in the Layout setting, choose conditional and apply the following condition:

if(vshow = 1, 1,0)

For the Search objects, in the Layout setting, choose conditional and apply the following condition:

if(vshow = 2, 1,0)

See the attached QVW.

Rgds,

Benazir

capriconuser
New Contributor III

Re: show/hide objects

hi thankus for your answer here i want when i open file then first want to display all objects by default

like here when i open file search object is hide where as first i want to show objects and when click on show/hide1 then want to hide search object

capriconuser
New Contributor III

Re: show/hide objects

and one thing will you please explain this


if(vshow = 1, 1,0)


and


if(vshow = 2 1,0)



here how this works

olivierrobin
Valued Contributor III

Re: show/hide objects

add a trigger on opening the document ; set the variable to 1

-> put conditional display of all your objects : variable=1

put an action on a button to set variable to 0

benazirkhan
Contributor II

Re: show/hide objects

OK.

See you have a variable defined "vshow". Now every time user click button1, the button action sets the variable to 1 and when the user clicks on button2, the second button's action will set it to 2.

In your text objects, if you set the object to be conditionally displayed, then you have to set a condition. this IF condition:

if(vshow = 1, 1,0)

simply means that if the variable vshow is set to 1, then return 1, else return 0 - this is a binary return where 0 means hide object and 1 means show object.


if(vshow = 2, 1,0) means - show the object if vshow = 2, else hide it.

benazirkhan
Contributor II

Re: show/hide objects

Here's how to achieve the default "Show All"

btn 1.PNG

Set the On Open actions in this window as follows:

btn 2.PNG

next update the conditions on your objects:

btn 3.PNG

Lastly, add another button (i used the idle button in your app) - and put it as show all with this action:

btn 4.PNG

See the attachment for more help.

Rgds,

Benazir

Highlighted
palanimurugan
New Contributor III

Re: show/hide objects

Hi..

You can do it using single button as you mentioned criteria, no need button 2.

I have attached the  sample QVW file please refer and confirm.