Provide button with option to mark as Used for UI. - Mendix Forum

Provide button with option to mark as Used for UI.


We all know the warning "No 'On click' action specified. Of course, this is a valid warning and you would like to be informed when you forget to set a microflow when that's necessary, but the majority of the time you are using a button as a 'dummy', and it was intended to select the On click option 'Do nothing'. 


Since we still want the warnings when we forget to set a microflow when that's desirable, I suggest adding an option like 'Used for UI" to the edit action of the button so that the warning can be removed automatically once this option is selected. What could also work is to not set the default option to 'do nothing' but to empty, so that when a user selects 'do nothing' this indeed doesn't do anything and will not result in a warning.


We do want to clear all warnings, but the option to solve this warning is either to create a microflow that doesn't do anything or go for a CSS solution that disables the button for a specific scenario but adding the above suggestion would be in my opinion very useful and a relief for a lot of developers.

3 answers

I wholeheartedly agree with Wesley's assessment here. If the platform offers a 'do nothing' option, then having it being raised as a warning does not make sense. especially since it is the default. An alternative could be to have an empty value as a default, then it makes sense as the developer deliberately selects the button to 'do nothing'.


Hi Arjan,


In many of the projects I've been on, it's quite normal to add two buttons to a page. One button that 'does nothing' and is greyed out and is visible when, for example, the user needs to make changes first, and the other one becomes visible when the user is eligible to click on it and triggers the necessary logic.


Of course, there are other ways of solving this but this is the easiest and quickest solution and also quite common. If the platform offers a 'do nothing' option, then it should not raise any warnings in my opinion. Either the option is offered to select 'mark for UI' so you can add buttons to a page that are for UI purposes only and do not have any logic connected, or the default option for a button should be empty and only raise the warning when no option is selected and not when the user selects the 'do nothing' option. 


To make a long story short, there are situations where buttons are added that use the 'do nothing' option to make it easier to add 'disabled' buttons and in the current situation this throws unnecessary warnings. 


Could you explore this idea a bit more?

In which use cases do you want to use a button that does nothing?

(Does it really do nothing?)