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
+64-25Lines changed: 64 additions & 25 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
+
*[Object data source](#object-datasource)
62
64
*[selection](#selection)
63
65
64
66
### XML Elements
@@ -480,9 +482,6 @@ Then the Studio Pro UI for the property appears like this:
480
482
481
483
### Action {#action}
482
484
483
-
{{% alert color="info" %}}
484
-
The `defaultType` and `defaultValue` attributes for Action were introduced in Mendix [10.15](/releasenotes/studio-pro/10.15/).
485
-
{{% /alert %}}
486
485
487
486
The action property type allows a user to configure an action which can do things like call nanoflows, save changes, and open pages.
488
487
@@ -746,41 +745,37 @@ Then the Studio Pro UI for the property appears like this:
746
745
747
746
### Datasource {#datasource}
748
747
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.
748
+
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 an **object data source** (`isList="false"`) for working with a single object.
750
749
751
750
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
751
753
-
{{% alert color="warning" %}}
754
-
Only list datasources are supported, therefore specifying `isList="true"` is required.
755
-
{{% /alert %}}
756
-
757
752
#### XML Attributes
758
753
759
754
| Attribute | Required | Attribute Type | Description |
|`isList`| Yes | Boolean |`true`for a list data source, `false` for an object data source|
764
759
|`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`|
760
+
|`defaultType`| No | String | Default type for the property, see [Default Data Sources](#data-source-defaults)|
766
761
|`defaultValue`| No | String | Default value for the property, see [Default Data Sources](#data-source-defaults)|
767
762
768
763
##### Data Source Defaults {#data-source-defaults}
769
764
770
-
{{% alert color="info" %}}
771
-
The `defaultType` and `defaultValue` attributes for datasources were introduced in Mendix [10.16](/releasenotes/studio-pro/10.16/).
772
-
{{% /alert %}}
773
-
774
765
You can use the `defaultType` and `defaultValue` attributes to configure default data sources for your widget. Unless overridden in Studio Pro, the widget will attempt to configure the data source according to its defaults. Both attributes need to be set for the defaults to be applied.
775
766
776
767
The format of `defaultValue` depends on the chosen `defaultType`:
|`Database``Association`| Entity Path |`ModuleName.EntityName` or `ModuleName.A/ModuleName.A_B/ModuleName.B`| List data source |
772
+
|`Microflow``Nanoflow`| Document ID |`ModuleName.DocumentName`| List and object data source |
782
773
783
-
#### Studio Pro UI
774
+
#### List Data Source {#list-datasource}
775
+
776
+
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). For more information on available data source type, see [Data Sources](/refguide/data-sources/#list-widgets).
777
+
778
+
##### Studio Pro UI
784
779
785
780
When the property is defined as follows:
786
781
@@ -793,14 +788,57 @@ When the property is defined as follows:
793
788
794
789
Then the Studio Pro UI for the property appears like this:
The property type was introduced in Mendix [10.7](/releasenotes/studio-pro/10.7/).
796
+
The object data source was introduced in Mendix [11.11](/releasenotes/studio-pro/11.11/).
802
797
{{% /alert %}}
803
798
799
+
An 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).
800
+
801
+
A widget may have, at maximum, **one** object data source property.
802
+
803
+
The available source types differ from list data sources:
#### Linking Properties to Data Sources {#datasource-linking}
826
+
827
+
The [`action`](#action), [`attribute`](#attribute), [`association`](#association), [`expression`](#expression), [`text template`](#texttemplate), [`widgets`](#widgets), and [`selection`](#selection) properties can be linked to a data source using the `dataSource` attribute on those properties. The client type received by the component depends on the data source type:
828
+
829
+
| Property type | List data source client type | Object data source client type |
|`association`|[`ListReferenceValue` or `ListReferenceSetValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listassociationvalue)|`ReferenceValue` or `ReferenceSetValue`|
|`selection`|`SelectionSingleValue` or `SelectionMultiValue`|*Not supported*|
838
+
839
+
### Selection {#selection}
840
+
841
+
804
842
The selection property allows a widget to read and set a selection that can be used in actions, expressions, or a `Listen to` data source of a data view.
805
843
806
844
#### XML Attributes
@@ -813,6 +851,10 @@ The selection property allows a widget to read and set a selection that can be u
813
851
|`defaultValue`| No | String (Expression) | Default value for the property |
814
852
|`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
853
854
+
{{% alert color="warning" %}}
855
+
The `dataSource` attribute must refer to a [list data source](#list-datasource). Linking a selection property to an object data source is not supported.
856
+
{{% /alert %}}
857
+
816
858
#### XML Elements
817
859
818
860
`<selectionTypes>` (required) — This element encapsulates `<selectionType>` elements which declare supported selection types available while configuring the selection property in Studio Pro.
@@ -867,9 +909,6 @@ Label property allows a pluggable widget to have labeling functionality similar
867
909
868
910
#### setLabel {#setLabel}
869
911
870
-
{{% alert color="info" %}}
871
-
The `setLabel` attribute was introduced in Mendix [10.5](/releasenotes/studio-pro/10.5/).
872
-
{{% /alert %}}
873
912
874
913
You can use `setLabel` to specify which properties can be used to set the `Label` property value.
0 commit comments