Onclick of a button disable the Input widget.

Hi All,


Can I pls know how to disable an input widget on onclick of a button.

mvp_badge
MVP

Hi,

Take a local variable as boollen type and set default True value.

Assign it to input widget "Enable property".

When you click on button assign it to false this variable.


Hope this will help you.

Regards

Rahul


Hello Akshata ,

You can take a local variable of type Boolean with default value set to true .Then assign the input widget to the "Enable Property"  and On click of the button assign the property to false. 

Please find attached .OML for solution.

Hope this will help you.

Regards

Anuli.



Forum.oml

Great!!

Hi @Akshata Tallur ,
We can take a local variable of type Boolean and we can set the default to true,
then we can assign the input widget to the "Enable Property"
and when we click on the button we assign the property to false.
For better understanding I have attached the oml, Hope that would help you understand better.

Regards
Swapnil Sinha

InputDisable.oml

Hi 

You can take a local variable of type boolean with default value set to true .

now at enable property of input widget set this variable .

and now at onclick action handler set local variable value to false .

i hope this would help you.

Hello

If you want to do it with JavaScript you can do that this way, by using a line of code 

you just have to pass a widget Id  and here you can achieve it

working demo link - https://personal-wwkmlamd.outsystemscloud.com/SampleDisableWidget/SampleWidgetsScreen?_ts=637935293461411046

To make it enable just change true with false,

I am also attaching oml it will help

I hope this helps 

Thanks

SampleDisableWidget.oml

Hi @Akshata Tallur 

You need to create a local variable of Boolean datatype on your screen with default value as True and set the Enable property of widget as the local variable. 

Add a assignment on onclick action of the button to set the local variable as False.

Attaching the OML file for the same. Hope this helps!!

Thanks

DisableWidget.oml

Hi @Akshata Tallur 

You create local variable of Boolean data type and use It.

Disableonbuttonclick.oml

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