You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/pluggable-widgets-property-types.md
+72-8Lines changed: 72 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,8 @@ This defines a property's type. A `type` must be one of the following:
59
59
*[object](#object)
60
60
*[file](#file)
61
61
*[datasource](#datasource)
62
+
*[List data source](#list-datasource)
63
+
*[Single object data source](#single-object-datasource)
62
64
*[selection](#selection)
63
65
64
66
### XML Elements
@@ -746,23 +748,19 @@ Then the Studio Pro UI for the property appears like this:
746
748
747
749
### Datasource {#datasource}
748
750
749
-
The datasource property allows widgets to work with object lists. The client component will receive value prop of type [`ListValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listvalue) and may be used with [`action`](#action), [`attribute`](#attribute), [`association`](#association), [`expression`](#expression), [`text template`](#texttemplate), and [`widgets`](#widgets) properties. See [Data Sources](/refguide/data-sources/#list-widgets) for available data source types.
751
+
The datasource property allows widgets to work with data from the Mendix Platform. It comes in two variants controlled by the `isList` attribute: a **list data source** (`isList="true"`) for working with collections of objects, and a **single object data source** (`isList="false"`) for working with a single object.
750
752
751
753
If no data source has been configured by the user, any properties that are linked to the datasource property are automatically omitted from the props passed to the client component (even if they are marked as required).
752
754
753
-
{{% alert color="warning" %}}
754
-
Only list datasources are supported, therefore specifying `isList="true"` is required.
755
-
{{% /alert %}}
756
-
757
755
#### XML Attributes
758
756
759
757
| Attribute | Required | Attribute Type | Description |
|`isList`| Yes | Boolean |`true`for a list data source, `false` for a single object data source|
764
762
|`required`| No | Boolean | This decides if the user is required to specify a datasource, `true` by default |
765
-
|`defaultType`| No | String | Default type for the property, supported values are `Database`, `Microflow`, `Nanoflow`, and `Association`|
763
+
|`defaultType`| No | String | Default type for the property, see [Default Data Sources](#data-source-defaults)|
766
764
|`defaultValue`| No | String | Default value for the property, see [Default Data Sources](#data-source-defaults)|
767
765
768
766
##### Data Source Defaults {#data-source-defaults}
@@ -780,7 +778,22 @@ The format of `defaultValue` depends on the chosen `defaultType`:
780
778
|`Database``Association`| Entity Path |`ModuleName.EntityName` or `ModuleName.A/ModuleName.A_B/ModuleName.B`|
781
779
|`Microflow``Nanoflow`| Document ID |`ModuleName.DocumentName`|
782
780
783
-
#### Studio Pro UI
781
+
#### List Data Source {#list-datasource}
782
+
783
+
A list data source (`isList="true"`) allows a widget to work with a collection of objects. The client component receives a prop of type [`ListValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listvalue). See [Data Sources](/refguide/data-sources/#list-widgets) for available data source types.
784
+
785
+
A list data source may be linked to [`action`](#action), [`attribute`](#attribute), [`association`](#association), [`expression`](#expression), [`text template`](#texttemplate), and [`widgets`](#widgets) properties using the `dataSource` attribute on those properties. When linked to a list data source, those properties receive their list-aware counterparts in the client component:
786
+
787
+
| Property type | Client type when linked to list data source |
|`association`|[`ListReferenceValue` or `ListReferenceSetValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listassociationvalue)|
#### Single Object Data Source {#single-object-datasource}
812
+
813
+
{{% alert color="info" %}}
814
+
The single object data source was introduced in Mendix [11.11](/releasenotes/studio-pro/11.11/).
815
+
{{% /alert %}}
816
+
817
+
A single object data source (`isList="false"`) allows a widget to work with a single object. The client component receives a prop of type [`DynamicValue<ObjectItem>`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#dynamic-value).
818
+
819
+
A widget may have at most one single object data source property.
820
+
821
+
The available source types differ from list data sources:
| Web | Context, Microflow, Nanoflow, Listen to widget |
826
+
| Native | Context, Microflow, Nanoflow |
827
+
828
+
A single object data source may be linked to [`action`](#action), [`attribute`](#attribute), [`association`](#association), [`expression`](#expression), [`text template`](#texttemplate), and [`widgets`](#widgets) properties using the `dataSource` attribute on those properties. When linked to a single object data source, those properties receive the same types as unlinked properties — there are no list-aware variants:
829
+
830
+
| Property type | Client type when linked to single object data source |
@@ -813,6 +873,10 @@ The selection property allows a widget to read and set a selection that can be u
813
873
|`defaultValue`| No | String (Expression) | Default value for the property |
814
874
|`onChange`| No | Property Path | The path to an [`action`](#action) property that will be run by the Mendix Platform when the selection is changed by the widget |
815
875
876
+
{{% alert color="warning" %}}
877
+
The `dataSource` attribute must refer to a [list data source](#list-datasource). Linking a selection property to a single object data source is not supported.
878
+
{{% /alert %}}
879
+
816
880
#### XML Elements
817
881
818
882
`<selectionTypes>` (required) — This element encapsulates `<selectionType>` elements which declare supported selection types available while configuring the selection property in Studio Pro.
0 commit comments