Control Appearance or Disappearance of  button via a switch
Application Type
Reactive
Service Studio Version
11.53.9 (Build 61018)

I have a switch button on my ExampleScreen  (not a toggle, as a toggle is not available) on my page. On it I also have have a button (JasonBTN). Would like to know the best way in Outsystems of controlling the visibility of the button through use of the switch. If the switch is changed to the right the button will show, if the switch is changed to the left it will not show. The default on the switch will be to keep it to the left. Any advice or direction would be most appreciated. 

Jason

RateEditor.oml

Hi Jason,

you have already made it more complex that it needs to be.

If the only thing regulated by that switch is the visibility of the button, you don't even need a changed event.

All you need more than you have now, is a local variable of type boolean with default value of False.  Set that boolean as the variable attached to the switch, and use that boolean as the Visible property of the button.  That's it.


Dorine

Solution

Hello

I have created a Oml for you,

have a look at it 

sample

Hope this helps

Thanks

SampleDisableBtn.oml

Hi Jason,

you have already made it more complex that it needs to be.

If the only thing regulated by that switch is the visibility of the button, you don't even need a changed event.

All you need more than you have now, is a local variable of type boolean with default value of False.  Set that boolean as the variable attached to the switch, and use that boolean as the Visible property of the button.  That's it.


Dorine

Solution

Hello

I have created a Oml for you,

have a look at it 

sample

Hope this helps

Thanks

SampleDisableBtn.oml

Thank you !

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.