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.

Reference Set Selector

Last modified: April 18, 2024

The reference set selector allows you to set an association of type reference set by selecting objects. For example, if customers can belong to several groups, a reference set selector can be used to select the groups the customer belongs to. This requires that there is an association from customer to group of type reference set in the domain model.

The reference set selector looks a lot like a data grid and consequently shares many properties with the data grid. Main differences are that the reference set selector lacks a search bar and that it has different buttons by default (Add, Remove).

Components

Control Bar

See Control Bar.

Sort Bar

See Sort Bar.

Columns

See Columns for more information.

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

Appearance Properties

Show Control Bar

This property indicates whether the control bar will be visible in the end user interface. The control bar also includes the paging buttons.

Default value: True

Show Paging Buttons

This property indicates whether the buttons to page through the information in the grid are visible or not. Only hide these buttons if you are sure that there will never be more objects than the number of rows of the grid. Note that hiding the control bar also hides the paging buttons.

Default value: True

Column Weights

The column weights are percentages separated by semi-colons. They determine the widths of the columns. The weights have to add up to 100. An alternative way of changing the widths of columns is by dragging the separating line between columns.

Number of Rows

With this property you can change the number of rows that will be shown in one page. See also the property ‘Show empty rows’.

Default value: 5

Show Empty Rows

If you choose to show empty rows there will always be the grid that shows the same number of rows (see ‘Number of rows’) even if there are fewer objects to show on the page.

Default value: False

Behavior Properties

Selection Mode

The selection mode determines whether and how the user can select items in the grid.

Value Description
No selection The user cannot select items.
Single selection The user can select a single item by clicking on it. Clicking another item will make that item the selection.
Multi-selection The user can select multiple items by clicking the first one and holding the ‘Ctrl’ key while clicking on other items. Simply clicking an item will deselect all items and make the clicked item the selection.
Simple multi-selection The user can select multiple items by simply clicking on them. This was the default multi-selection behavior prior to version 3.1.0.

Default value: Single selection

Default Button Trigger

The default button can be triggered by a single or a double click a row.

Value Description
Single click A single click triggers the default button. This cannot be used in combination with allowing the user to select rows.
Double click A double click triggers the default button.

Default value: Double click

Tooltip Page

A tooltip page is a page that appears when you hover your mouse over a row. The tooltip page should consist of a data view on the same entity as the data grid. On top of creating, and connecting, a tooltip page you also have to specify on which columns the tooltip will appear. See the property ‘Show tooltip’ of data grid columns.

Data Source Properties

Entity Path

The entity path of a reference set selector is a path following one association of type ‘reference set’ from the entity of the containing data view to the entity on the other side of that association. In the example above the association Customer_Group from Customer to Group is followed and the path is: Customer_Group/Group.

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.

Selectable Objects Properties

The selectable objects are determined in the same way as in the reference selector. See the selectable objects properties of the reference selector for more information. Note that you cannot use a microflow in a reference set selector.

XPath Constraint

See Selectable Objects Properties of the reference selector.

Constrained By

See Selectable Objects Properties of the reference selector.

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.

Read More