EditableByCondition
Overview
Documentation
Description
Manage Dataview editability based on a boolean attribute or boolean microflow output. All child widgets of the datavuew -including butons- will be set to non-editable.
Typical usage scenario
When editability of Dataviews needs to be set either editable or non-editable based on business logic. The default Mendix Dataview can only be set with a 'hard' boolean setting not being able to incorporate logic. Because of this when building more complex pages, pages/snippets have to be duplicated, making the application less maintainable.
Be aware, this widget DOES NOT REPLACE ENTITY ACCESS FOR EDIT RIGHTS. A javascript savvy person could still in runtime change the editability of the inputfield and save the object if no proper entity access is set. Some javascript code like: var widget = dijit.ById("mxui_widget_TextInput_3"); widget.set("disabled",false) could then be used to do things that should not be allowed.
Features and limitations
- Make the dataview editable based on either a boolean attribute in the context dataview object or by feeding the widget a datasource microflow with boolean outcome.
- Whichever you choose, there will also be the possibility to conditionally hide specific buttons.
Configuration
Always add the widget in the top most dataview, since the widget will manage the editability of all child widgets of that widget. When choosing to manage editablity based on a boolean attribute, then this boolean attribute needs to be in the dataview object you have dragged this widget into.
For the proper widget settings, see added print screens.