Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.

Check Box

Last modified: May 3, 2023

A checkbox is an input widget that can be used to display and edit Boolean attributes. It will display a tick if the value is true and remain empty if it is false.

Data source properties

Attribute (path)

Many input widgets, like text boxes and drop-down widgets, can be connected to:

  1. an attribute of the entity of the data view that contains the widget
  2. an attribute of an entity associated with the data view entity by following one or more associations of type reference through the domain model.

In the first case we say the widget is connected to an attribute and in the second case to an attribute path.

An input widget connected to an attribute path must be read-only. The Modeler will check this for you.

Label properties

A label can be used to described the purpose of the widget to the user. The label is shown next to the widget in the user interface. If a label is configured, the widget will be rendered in the browser wrapped in a form group. See Bootstrap documentation.

Show label

This property determines whether the label is rendered and the widget is wrapped in a form group.

Default value: No

Label caption

This property is shown only when Show label is Yes. This property determines what text is rendered within a label.

Text template

The template for the label can contain parameters that are written as a number between braces (for example, {1}). The first parameter has the number 1, the second 2, etc. Note that to use template parameters, the widget must be placed in the context of an entity (for example, inside a data view or list view).

Parameters

For each parameter in the template, you define an attribute of the context entity or a referred entity, of which the value will be inserted at the position of the parameter.

Editability properties

Editable

The editable property indicates whether the end user will be able to change the value displayed by the widget.

Value Description
Default The value is editable if security allows it (i.e. if the user that is signed in has write rights to the selected attribute).
Never The value is never editable.
Conditional The value is editable if the specified condition holds. (see below)

Default value: Default

Read-only style

This property determines how the widget is rendered if it is read-only.

Value Description
Based on data view Set to Control or Text by the containing data view. (Default value for widgets inside a data view)
Not enclosed by a data view Defaults to Text. (Default value for widgets outside a data view)
Inherited from snippet call Set to Control or Text by the containing data view of the snippet call, or Text when the snippet call is not enclosed by a data view. (Default value for widgets outside a data view inside a snippet)
Control Widget is displayed but disabled so the value cannot be modified.
Text Widget is replaced by a textual representation of the value.

Condition

The widget can be made editable only if the object of the data view that contains the widget satisfies the specificied criteria.

A practical example would be a personal details form in which the user must enter their marital status. In this case, you might wish to disable an input for the marriage date until the user indicates that they are married.

Based on Attribute Value

When selected, this enables the widget while a particular attribute has a certain value. Only Boolean and enumeration attributes can be used for this purpose.

Based on Expression

Added in Mendix 7.1.

When selected, this enables the widget while a provided expression evaluates to true. The object of the containg data view is available inside an expression as a $currentObject variable.

Note that the expression is evaluated in the browser, and hence, we advise against using “secret” values (like access keys) in it. In particular, we disallow usages of constants. Also, client-side expressions currently do not support all the functions that are available in the microflows. Please refer to an autocomplete list to know what functions are supported in your version.

Visibility properties

Visible

By default, whether or not an element is displayed in the browser is determined by how the page is designed and the user’s roles within the application. However, the page can be configured to hide the element unless a certain condition is met.

Context

The widget can be made visible only if the object of the data view that contains the widget satisfies the specificied criteria.

A practical example would be a web shop in which the user must submit both billing and delivery information. In this case, you might not wish to bother the user with a second set of address input fields unless they indicate that the billing address and delivery address are not the same. You can accomplish this by making the delivery address fields conditionally visible based on the Boolean attribute SameBillingAndDeliveryAddress.

Based on Attribute Value

When selected, this shows the widget while a particular attribute has a certain value. Only boolean and enumeration attributes can be used for this purpose.

Based on Expression

Added in Mendix 7.1.

When selected, this shows the widget while a provided expression evaluates to true. The object of the containing data view is available inside an expression as a $currentObject variable.

Note that the expression is evaluated in the browser, and hence, we advise against using “secret” values (like access keys) in it. In particular, we disallow usages of constants. Also, client-side expressions currently do not support all the functions that are available in the microflows. Please refer to an autocomplete list to know what functions are supported in your version.

Module Roles

The widget can be made visible to a subset of the user roles available in your application. When activated, this setting will render the widget invisible to all users that are not linked to one of the selected user roles.

Events properties

On change

The on-change property optionally specifies an action that will be executed when leaving the widget after the value has been changed.

Action Effect
Do nothing Nothing happens. This is useful for setting up a page without defining the underlying functionality.
Show a page The specified page is shown.
Call a microflow The specified microflow is executed.
Call a nanoflow The specified nanoflow is executed.
Open link Triggers an action based on the link type, some of which are specific to mobile devices.
Save changes Commits all changes made on the page.
Cancel changes Rolls back all changes made on the page.
Close page Closes the pop-up window (for pop-up pages) or navigates to the previously visited page (for content pages).
Synchronize Synchronizes the data stored locally on your device with the server database.
Sign out Signs out the currently signed-in user. When no user is signed in, clicking this button has no effect.

Default value: Do nothing

Page (Only for “Show a page”)

The page that should be shown.

For more information, see Opening Pages.

Microflow (Only for “Call a microflow”)

The microflow that should be executed.

Microflow Settings (Only for “Call a microflow”)

The microflow settings specify what parameters will be passed to the microflow, whether to show a progress bar or not, and more.

For more information, see Starting Microflows.

Nanoflow (Only for “Call a nanoflow”)

The nanoflow that should be executed.

This specifies the type of action triggered when pressing the button. These are the options:

Value Description
Web Navigate to a website URL.
Email Compose an email.
Call Start a phone call.
Text Send a text message.

Default value: Web

Address (Only for “Open link”)

Usage of the address property depends on the chosen link type. The property is used either as a URL (Web), as an email address (Email), or as a phone number (Call/Text).

The address can be set to either a literal value or an attribute value.

Address Value (Only for “Open link”)

If a literal value is chosen for the address, you can enter the value here.

Address Attribute (Only for “Open link”)

If an attribute is chosen for the address, you can select the attribute here. An address attribute specifies the path to an attribute. The path starts at the entity of the data view in which the link button is contained.

Close Page (Only for “Save changes” and “Cancel changes”)

This flag indicates whether the current page should be closed.

Sync Automatically (Only for “Save changes”)

When an object is saved in a Mendix application running in an offline profile, this information is stored in a local database until it can be synchronized with the server. In practice, this means that uploading a new object to the server requires two distinct actions: saving the object and syncing it.

This flag indicates whether synchronization should happen when the Save button is clicked.

On enter

The on-enter property optionally specifies an action that will be executed when the widget is entered, either by using the Tab key or by clicking it with the mouse.

Action Effect
Do nothing Nothing happens. This is useful for setting up a page without defining the underlying functionality.
Show a page The specified page is shown.
Call a microflow The specified microflow is executed.
Call a nanoflow The specified nanoflow is executed.
Open link Triggers an action based on the link type, some of which are specific to mobile devices.
Save changes Commits all changes made on the page.
Cancel changes Rolls back all changes made on the page.
Close page Closes the pop-up window (for pop-up pages) or navigates to the previously visited page (for content pages).
Synchronize Synchronizes the data stored locally on your device with the server database.
Sign out Signs out the currently signed-in user. When no user is signed in, clicking this button has no effect.

Default value: Do nothing

Page (Only for “Show a page”)

The page that should be shown.

For more information, see Opening Pages.

Microflow (Only for “Call a microflow”)

The microflow that should be executed.

Microflow Settings (Only for “Call a microflow”)

The microflow settings specify what parameters will be passed to the microflow, whether to show a progress bar or not, and more.

For more information, see Starting Microflows.

Nanoflow (Only for “Call a nanoflow”)

The nanoflow that should be executed.

This specifies the type of action triggered when pressing the button. These are the options:

Value Description
Web Navigate to a website URL.
Email Compose an email.
Call Start a phone call.
Text Send a text message.

Default value: Web

Address (Only for “Open link”)

Usage of the address property depends on the chosen link type. The property is used either as a URL (Web), as an email address (Email), or as a phone number (Call/Text).

The address can be set to either a literal value or an attribute value.

Address Value (Only for “Open link”)

If a literal value is chosen for the address, you can enter the value here.

Address Attribute (Only for “Open link”)

If an attribute is chosen for the address, you can select the attribute here. An address attribute specifies a path to an attribute. The path starts at the entity of the data view in which the link button is contained.

Close Page (Only for “Save changes” and “Cancel changes”)

This flag indicates whether the current page should be closed.

Sync Automatically (Only for “Save changes”)

When an object is saved in a Mendix application running in an offline profile, this information is stored in a local database until it can be synchronized with the server. In practice, this means that uploading a new object to the server requires two distinct actions: saving the object and syncing it.

This flag indicates whether synchronization should happen when the save button is clicked.

On leave

The on-leave property optionally specifies an action that will be executed when leaving the widget, either by using the Tab key or by clicking another widget.

Action Effect
Do nothing Nothing happens. This is useful for setting up a page without defining the underlying functionality.
Show a page The specified page is shown.
Call a microflow The specified microflow is executed.
Call a nanoflow The specified nanoflow is executed.
Open link Triggers an action based on the link type, some of which are specific to mobile devices.
Save changes Commits all changes made on the page.
Cancel changes Rolls back all changes made on the page.
Close page Closes the pop-up window (for pop-up pages) or navigates to the previously visited page (for content pages).
Synchronize Synchronizes the data stored locally on your device with the server database.
Sign out Signs out the currently signed-in user. When no user is signed in, pressing this button has no effect.

Default value: Do nothing

Page (Only for “Show a page”)

The page that should be shown.

For more information, see Opening Pages.

Microflow (Only for “Call a microflow”)

The microflow that should be executed.

Microflow Settings (Only for “Call a microflow”)

The microflow settings specify what parameters will be passed to the microflow, whether to show a progress bar or not, and more.

For more information, see Starting Microflows.

Nanoflow (Only for “Call a nanoflow”)

The nanoflow that should be executed.

This specifies the type of action triggered when pressing the button. These are the options:

Value Description
Web Navigate to a website URL.
Email Compose an email.
Call Start a phone call.
Text Send a text message.

Default value: Web

Address (Only for “Open link”)

Usage of the address property depends on the chosen link type. The property is used either as a URL (Web), as an email address (Email), or as a phone number (Call/Text).

The address can be set to either a literal value or an attribute value.

Address Value (Only for “Open link”)

If a literal value is chosen for the address, you can enter the value here.

Address Attribute (Only for “Open link”)

If an attribute is chosen for the address, you can select the attribute here. An address attribute specifies a path to an attribute. The path starts at the entity of the data view in which the link button is contained.

Close Page (Only for “Save changes” and “Cancel changes”)

This flag indicates whether the current page should be closed.

Sync Automatically (Only for “Save changes”)

When an object is saved in a Mendix application running in an offline profile, this information is stored in a local database until it can be synchronized with the server. In practice, this means that uploading a new object to the server requires two distinct actions: saving the object and syncing it.

This flag indicates whether synchronization should happen when the save button is clicked.

Common properties

Name

The internal name of the widget. You can use this to give sensible names to widgets. The name property also appears in the generated HTML: the widget DOM element automatically includes the class mx-name-{NAME}, which can be useful for Selenium testing.

Class

The class property allows you to specify one or more cascading style sheet (CSS) classes for the widget. The classes should be separated by a space. The classes will be applied to the widget in the browser and the widget will get the corresponding styling. The classes should be classes in the theme that is used in the project. It overrules the default styling of the widget.

Styling is applied in the following order:

  1. the default styling defined by the theme the project uses
  2. the Class property of the widget
  3. the Style property of the widget.

You can see which widgets in a page have styling applied via the class or style property by clicking the Show styles button.

Location and effect of the Show styles button

Style

The style property allows you to specify additional CSS styling. If a class is also specified, this styling is applied after the class.

For example:

background-color:lightblue; color:red;

will result in red text on a blue background.

You can see which widgets in a page have styling applied via the style or class property by clicking the Show styles button.

Tab index

The tab index influences the order in which the end user navigates through the page using the tab key. By default tab indices are zero and the tab order is determined automatically by the client system. A value of minus one (-1) means that the widget will be skipped when tabbing through the page.

Default value: 0