How to disable button in mendix

Hi, Actually I need to disable button in my application but I did not find any property/way to disable that button Is there any way or CSS which will help me to disable button in application? Note: Button is placed outside Data View  
3 answers

In Studio Pro, double-click the button widget to open its properties/configurations. On top, go to Appearance tab. 
Then you see there you can specify classes for the button in “Common” section

Just add disabled class there as shown above. disabled is available as a built-in helper class. You don’t need to write any custom CSS 

Your button will be displayed as disabled. 

If it is inside a data view, then you can use dynamic classes to disable button based on some condition. You will have to write an expression like
if {condition_here} then ‘disabled’ else ‘’


Have a look at for some idea on how to do this with the help of css.

Not sure on why you’d need to create a disabled button though. Just make sure that the button is not available based on permissions for example.


Hi Samarth, 

I am not sure exactly what you need to disable the button for, but as Erwin mentioned this could be achieved by selecting the button, and on its properties settings, you can select all the roles that should be able to see the button or access a functionality. Or you can hide it entirely using the “Visibility” section. 

Additionally if you want it to be visible under other conditions, you can use the “based on expression” section under the visibility configuration menu, and make specific requirements as to when it should become available. 

Hope this helps.