Set Attribute

Category: Widgets
Subcategory: Display widgets

Overview

Use this widget to find DOM nodes and to set the value of an attribute. It also lets you create custom styling on nodes that are not directly accessible from the modeler, as well as set a custom keyboard on mobile. 

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.

Note: combining the widget with custom visibility may result into unexpected or inconsistent behavior, which is not supported.

##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.