Non editable attributes in custom widgets - Mendix Forum

Non editable attributes in custom widgets


Default widgets like buttons are disabled if a microflow can't be called with the current role and an input field is disabled if a role does not allow editing.

Custom widgets have no knowledge about entity access.  So you must create multiple versions of a page, both editable and readonly. That is only sufficient in simple cases and not with complex entity access, or you must add extra booleans for conditional visibility and editability.


This can be improved in the client api with the following steps.

  1.  In case of a context widget
  2. An attribute property gets an attribute "applyAccess"
  3. In case applyAccess = true the client api calls 'disable' or 'enable' of the widget when the effective rights are calculated..


This will enable widgets controlling one attribute with a custom visualization like checkbox, slider to behave correctly.



2 answers

Thanks, that helps. I will implement that in the widgets.


For attributes this is not correct. There's an MxObject.isReadonlyAttr(attr) method. But a lot of widgets don't respect that.

For microflows something like that might be usefull indeed.