Skip to content

MindSphere Web Components Widgets for Mendix

Overview

MindSphere Web Components Widgets for Mendix are a set of ready-to-use building blocks (based on the MindSphere Web Components). They can be inserted into custom Mendix applications by using Mendix simple drag and drop functionality. The following components are currently available as a Mendix widgets:

  • Aspect Variable Selector
  • Asset Map
  • Asset View
  • Custom Map
  • Date Time Range Picker
  • Event View
  • File View
  • Map
  • Rule View
  • Time Series Chart

The MindSphere Web Components as Mendix Widgets offered by this package are simple wrappers between the MindSphere Web Components, the Mendix Studio Pro and your application. When starting your application the MindSphere Web Components are loaded into your browser, bound to your application and the configuration given in the Mendix Modeler is applied.

Info

Note that the version of the MindSphere Web Components used in this package may be discontinued in the future. It is recommended to check the availability of the MindSphere Web Components regularly and to prepare an update or a discontinuation of your application.

Get the MindSphere Web Components Widgets

The MindSphere Web Components Widgets can be downloaded directly via the Mendix App Store. To get the MindSphere Web Components Widgets directly imported into your project, we recommend to start the App Store via the Mendix Modeler. After Downloading the Web Components Widgets, they appear in the Toolbox once you open up a Page. starting point

General information about Mendix widgets

For general information about the widget technology within Mendix, refer Widgets on the Mendix web site.

Local Development

Web Components Widgets fetch data on their own from MindSphere by calling the MindSphere APIs. While the Application is running as a registered MindSphere App, this will work without any further user interaction. In order to work locally, a MindSphere API reverse proxy is necessary.

If you develop a Mendix application running within the MindSphere eco system (Mendix on MindSphere), you can use the reverse proxy provided by the MindSphereSingleSignOn module. The reverse proxy is enabled by default.

starting point

If you develop a Mendix Standalone application (MindSphere IIoT for Makers), you can use the reverse proxy provided by the MindSphere IIoT Authenticator. The reverse proxy is enabled by default.

starting point

Note

The MindSphere IIoT Authenticator module is not compatible with the MindSphereSingleSignOn module. Details about the different integration methods can be found here.

Limitations

  • Rule View: Currently it is not possible to delete a rule when running locally using the MindSphere API reverse proxy. The component works fine when the app is deployed and runs in the Cloud.

Widget Usage

General

After importing the MindSphere Web Components Widgets into your project, you can find them in the Toolbox of your pages.

starting point

By performing drag & drop, you can easily integrate the widgets into your pages. Note that the MindSphere Web Components Widgets need to be in the context of a data container, for example Data view or Data grid to communicate with entities from your Domain Model.

Most MindSphere Web Components Widgets offer the same configuration parameters as the respective MindSphere Web Component. In some cases, not all configuration parameters are available. This document only outlines the differences between the MindSphere Web Components and the configuration of the MindSphere Web Components Widgets provided here.

For details about the parameters refer to the respective components documentation.

Each MindSphere Web Components Widget has a General tab. In this tab, general settings like the components language or refresh behavior and custom Error Handling can be configured.

starting point

In addition to the respective MindSphere Web Components parameters, the following input / output fields are provided:

Input fields:

  • Context: Specifies the context of the widget.
  • Language: Specifies the language of the component.
  • Refresh (not available in all MindSphere Web Components Widgets): Specifies a boolean variable which triggers a refresh of the component if set to true. After refreshing the MindSphere Web Components Widget resets the variable to false to prepare the next refresh event.

Output fields:

  • Component error text: Specifies a String variable for storing error messages from the component (optional).
  • On error action: Specifies an action to be triggered in case of an error inside the component (optional).
  • On property changed action: Specifies an action to be triggered when one of the outputs has been changed (optional).

Widget Specifics

Aspect Variable Selector

starting point

The following Output parameter is provided:

  • Variable path: Specifies a String variable, where the selected Aspects/Variables will be stored in a JSON format. This value could directly be used on the time series chart component.

Note that the standard String variable’s length of 200 is reached very soon. It is recommended to use a String without length limitation.

The following parameter is required:

  • Selected asset IDs: All Aspects for the given Asset IDs are shown. Provide multiple Asset IDs as comma separated String variable.

starting point

Asset Map View

starting point

Only important properties of the Asset Map component are described here. Detailed information about the other properties can be found here:

  • Asset type filter: Specifies an Expression containing the asset type filter configuration. Default value is
1
2
3
4
'{
   "supportedTypes" : ["core.basicasset"],
   "includeInheritance" : true
}'
  • Selected asset action: Specifies an action which is triggered when the user selects one of the assets.

The following parameter is required:

  • Selected asset ID: The selected Asset ID is stored in this property

The tab IAsset contains properties from the IAsset interface specified here. All properties are optional. In order to use them create an entity and provide corresponding attributes with type:

Name data type hint
Is shared asset Boolean -
Is sharer Boolean -
TenantId String -
Name String -
etag Integer -
Subtenant String -
Description String -
Parent ID String -
Type ID String -
Timezone ID String -
TwinType String -
Aspects String JSON string. Use import mapping
to convert it to entities.
Variables String JSON string. Use import mapping
to convert it to entities.
File assignments String JSON string. Use import mapping
to convert it to entities.

The tab ILocation contains properties from the ILocation interface specified here. All properties are optional. In order to use them create an entity and provide corresponding attributes with type:

Name data type hint
Country String -
Region String -
Locality String -
Street address String -
Postal code String -
Latitude Decimal -
Longitude Decimal -

The tab Map State contains properties from the IMapViewPort and IMapCoordinates Interface specified here. If the map view will be changed (moved or zoom in/out) the properties will be set. All properties are optional. In order to use them create an entity and provide corresponding attributes with type:

Name data type hint
Current latitude Decimal -
Current longitude Decimal -
Current zoom level Integer -

Asset View

starting point

Documentation about all properties of the Asset View component can be found here.

In addition to the original Asset View component's parameters, the following properties are provided:

  • Selected asset action: Specifies an action which is triggered when the user selects one of the assets.
  • Dynamic view mode: Specifies a String variable which contains one of the values List, Card, Tree or CompactTree. If no valid String is specified, the MindSphere Web Components Widget is set to List mode.

The following parameter is required:

  • Selected asset ID: The selected Asset ID is stored in this property

The tab IAsset and ILocation contains the same properties as described on the Asset Map.

Custom Map

starting point

Documentation about the properties of the Custom Map component can be found here. You can customize the behavior of the custom map component on the Specific tab. Important properties are:

  • Show toolbar: Shows or hides the embedded toolbar which allows the upload of new images, the placement of assets on the image.

Info

Specify the value of this property based on roles. For example, only administrators are allowed to view the toolbar with its functionality.

The component exposes the following properties:

  • Selected asset action: This action is called whenever the user selects an asset.
  • Selected asset ID: This is set whenever the user selects an asset.

The following parameter is required:

  • Selected asset ID: The selected Asset ID is stored in this property.

DateTimeRange Picker

starting point

Documentation about the properties of the DateTimeRange Picker can be found here

The following parameters are required:

  • From: Specifies the start date of the selected range.
  • To: Specifies the end date of the selected range.

Event View

starting point

Documentation about the properties of the Event View can be found here

In addition to the original Event View component's parameters, the following property is provided:

  • Show Asset Name: Shows asset name instead of the asset ID.

The following parameters are required:

  • From: Specifies the start date of the selected range.
  • To: Specifies the end date of the selected range.

Info

Show all events in the tenant by setting the Asset ID property to none.

In the tab Column settings the visibility of columns in the event table can be configured.

The tab IMindSphereStandardEventAsset contains properties from the IBaseEvent and IMindSphereStandardEvent Interface specified here. All properties here are optional. In order to use them create an entity and provide corresponding attributes with type:

Name data type hint
Event Id String -
Event Ids String -
Severity Integer -
Description String -
Code String -
Source String -
Acknowledged Boolean -
Type Id String -
CorrelationId String -
Timestamp Date and Time -
Entity Id String -
Entity Name String Only available if Show Asset Name is true.
eTag Integer -

File View

starting point

Documentation about the properties of the File View can be found here

The property Updated From and Updated To can be used as a filter of the updated timestamp of the files. The filter is not applied in case these properties are empty.

Info

Both properties Updated From / To must be provided in order to use it as filter.

The following parameter is required:

  • Asset ID: Show files for given asset ID.

The tab IFile contains optional output properties about the selected file.

Map View

starting point

Documentation about the properties of the Map View can be found here

The tab Map State contains properties from the IMapViewPort and IMapCoordinates Interface specified here. If the map view will be changed (moved or zoom in/out) the properties will be set. All properties are optional. In order to use them create an entity and provide corresponding attributes with type:

Name data type hint
Current latitude Decimal -
Current longitude Decimal -
Current zoom level Integer -

Rule View

Starting point

Documentation about the properties of the Rule View can be found here

In addition to the original Rule View component's parameters, the following property is provided:

  • Show Asset Name: Shows asset name instead of the asset ID.

The following parameter is required:

  • Selected asset ID: The selected Asset ID is stored in this property

Time Series Chart

starting point

Documentation about the properties of the Time Series Chart can be found here

The following parameters are required:

  • From: Specifies the start date of the selected range.
  • To: Specifies the end date of the selected range.
  • Variable path: direct usage of the variable path from the Aspect Variable Selector is possible here.

In the Appearance tab, you can specify the width and height of the MindSphere Web Components Widget.

The Chart date range tab the current used date range on the chart is available. These values changes if the user zoom in / zoom out. Use the values to e.g. update the Date Time Range Picker.

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.