Set Attribute

Category: Widgets
Subcategory: Display widgets

Overview

Use this widget to find domNodes (by a normal selector string, e.g. .class, #id, .mx-name-mxId) and set the value of an attribute. Further it is possible to append an attribute. This can be used to add custom classes / styling to domNodes that are not directly usable. This widget empowers the developer to create custom styling on nodes that are not directly accessible from the modeler and to set a custom keyboard on mobile. Compatible with Mx 7, 8 and 9. Note that the widget may behave inconsistently if combined with conditional visibility.

Documentation

Demo url

Contributing

For more information on contributing to this repository visit Contributing to a GitHub repository!

Typical usage scenario

Mendix does not allow the developer to change / set the value of an attribute in the Modeler. Use this widget to find domNodes (by a normal selector string, e.g. .class, #id, .mx-name-mxId) and set the value of an attribute. Further it is possible to append an attribute. This can be used to add custom classes / styling to domNodes that are not directly usable.

##Examples

Use domNode: input to find input widgets and set attribute: type and get the right mobile keyboard:

  • datetime
  • email
  • month
  • number
  • range
  • search
  • tel
  • url

Use attribute: class and append: true to add classes

Use attribute: style and append: true to add css

 

Known bugs

None

Releases

Version: 2.1.0
Framework Version: 7.23.21
Release Notes: - Removed deprecated mx.logger warning. - Updated test project
Version: 2.0.0
Framework Version: null
Release Notes: Include Translatable Versions of the widget Removed nullExec deprication
Version: 1.0.1
Framework Version: null
Release Notes: Appending on a non-existing attribute resulted in an error.
Version: 1.0
Framework Version: null
Release Notes: Mendix does not allow the developer to change / set the value of an attribute in the Modeler. Use this widget to find domNodes (by a normal selector string, e.g. .class, #id, .mx-name-mxId) and set the value of an attribute. Further it is possible to append an attribute. This can be used to add custom classes / styling to domNodes that are not directly usable.