Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
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 ?

8 Replies
Highlighted
Specialist III
Specialist III

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

Highlighted
Creator II
Creator II

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

Highlighted
Contributor III
Contributor III

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

Highlighted
Contributor III
Contributor III

and one thing will you please explain this


if(vshow = 1, 1,0)


and


if(vshow = 2 1,0)



here how this works

Highlighted
Specialist III
Specialist III

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

Highlighted
Creator II
Creator II

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.

Highlighted
Creator II
Creator II

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
Contributor III
Contributor III

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.