An action button can call a microflow, open a page or do nothing.

Button properties

Caption

The caption defines the text that will be shown. The template can contain parameters that are written as a number between braces, e.g. {1}. The first parameter has number 1, the second 2 etcetera. Note that to use template parameters the widget must be placed in a context of an entity, e.g. inside a data view or list view. The parameters will be replaced by the values of the attributes.

Tooltip

The tooltip property determines the text you will see in the tooltip that appears when you hover over the button. The tooltip text is translatable. See Translatable Texts. If the tooltip is not specified, no tooltip will be shown when hovering over the button.

Image

This property indicates which image will be shown in front of the caption of the button.

Icon

The icon property determines the icon that will be shown in front of the caption of the button. There are three options: no icon, a glyph icon or a (bitmap) image. Glyph icons come from the Bootstrap Halflings collection. The advantages of a glyph icon over a bitmap image are that glyphs are scalable, look sharp on high-resolution screens and their color can be changed by changing the font color. The advantage of an image icon is that it can have multiple colors.

Render mode

This property indicates how the button is rendered.

Value Description
Button The trigger is rendered as a button.
Link The trigger is rendered as a hyperlink.

Default value: Button

Button Style

This property applies a predefined styling to the button.

Disable during action (only for microflow actions)

Disables the action button until the action is completed or failed.

Default value : false.

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 a cascading style sheet (CSS) class for the widget. This class will be applied to the widget in the browser and the widget will get the corresponding styling. The class should be a class from the theme that is used in the project. It overrules the default styling of the widget.

Note that the styling is applied in the following order:

  1. Default styling defined by the theme the project uses.
  2. The ‘Class’ property of the widget.
  3. The ‘Style’ property of the widget.

Style

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

background-color:blue; This will result in a blue background

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

Events properties

On Click

This property specifies what action is executed when the element is clicked. There are three options:

Action Effect
Do nothing Nothing happens. This is useful for setting up a page without defining the underlying functionality yet.
Show a page The specified page is shown.
Call a microflow The specified microflow is executed.
Save changes Commit all changes made on the page.
Cancel changes Roll back all changes made on the page.
Close page Close the pop-up for pop-up pages, or navigate to the previously visited page for content pages.
Synchronize Synchronize the data stored locally on your device with the server database.

Default value: Do nothing

Page (Only for “Show a page”)

The page that should be shown.

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.

See Starting Microflows.

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

This flag indicates whether the current page should be closed. See the Close page action above.

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.

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. These are the three options available:

Option Description
Applicable roles All access determined by page and microflow access is maintained. For instance, if the user does not have access to the microflow triggered by a certain microflow button, that button will remain hidden from that user.
All roles This setting overrides the setting above, rendering the element visible to all users, regardless of the security settings. Note that this does not provide the user access to the restricted data, it merely unveils the element. In the example above, the microflow button would become visible, but clicking it would still result in a return to the login page or an error.
Selected 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 the users that are not linked to one of the selected user roles. This does not provide the user access to the restricted data in the same way as the previous option.