cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide and Show a widget upon the click of a button

Hide and Show a widget upon the click of a button

This question has been asked previously but the answers were not very clear.

 

I know I can do an expression widget or a service and drag the "clicked" parameter to the service or expression and then drag the service or expression to the widget that i want displayed/hidden.

 

However, I guess I am not very good with JS because i can't figure out a way to specify that on the first click I want the widget 'visable' and then on the next click 'disappear'.

 

Any help is greatly appreciated

1 REPLY 1

Re: Hide and Show a widget upon the click of a button

Easy: Use a checkbox widget and bind checkbox value to visibility property of the desired widget.

"Complex:" Use a Expression widget with a parameter let's call it "value" of type BOOLEAN, and in the expression widget set (!value) as expression, set the return value of the expression widget to BOOLEAN, then bind the value of the widget to the visibility property that you want to show and hide. Then you just need to bind the click event of the button to the expression trigger event.