Skip to content

Commit 71c887b

Browse files
committed
Document default values for data sources
1 parent b9dfac1 commit 71c887b

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

content/en/docs/apidocs-mxsdk/apidocs/frontend/pluggable-widgets/pluggable-widgets-property-types.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,6 @@ Then the Studio Pro UI for the property appears like this:
710710

711711
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.
712712

713-
{{% alert color="info" %}}
714-
The ability to link association properties to a data source was introduced in Mendix [9.17](/releasenotes/studio-pro/9.17/).
715-
{{% /alert %}}
716-
717713
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).
718714

719715
{{% alert color="warning" %}}
@@ -722,12 +718,29 @@ Only list datasources are supported, therefore specifying `isList="true"` is req
722718

723719
#### XML Attributes
724720

725-
| Attribute | Required | Attribute Type | Description |
726-
|------------|----------|----------------|---------------------------------------------------------------------------------|
727-
| `type` | Yes | String | Must be `datasource` |
728-
| `key` | Yes | String | See [key](#key) |
729-
| `isList` | Yes | Boolean | Must be `true` |
730-
| `required` | No | Boolean | This decides if the user is required to specify a datasource, `true` by default |
721+
| Attribute | Required | Attribute Type | Description |
722+
|----------------|----------|----------------|------------------------------------------------------------------------------------------------------------|
723+
| `type` | Yes | String | Must be `datasource` |
724+
| `key` | Yes | String | See [key](#key) |
725+
| `isList` | Yes | Boolean | Must be `true` |
726+
| `required` | No | Boolean | This decides if the user is required to specify a datasource, `true` by default |
727+
| `defaultType` | No | String | Default type for the property, supported values are `Database`, `Microflow`, `Nanoflow`, and `Association` |
728+
| `defaultValue` | No | String | Default value for the property, see [Default Data Sources](#data-source-defaults) |
729+
730+
##### Data Source Defaults {#data-source-defaults}
731+
732+
{{% alert color="info" %}}
733+
The `defaultType` and `defaultValue` attributes for datasources were introduced in Mendix [10.16](/releasenotes/studio-pro/10.16/).
734+
{{% /alert %}}
735+
736+
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.
737+
738+
The format of `defaultValue` depends on the chosen `defaultType`:
739+
740+
| Data source type | Format | Example |
741+
|--------------------------|-------------|-----------------------------------------------------------------------|
742+
| `Database` `Association` | Entity Path | `ModuleName.EntityName` or `ModuleName.A/ModuleName.A_B/ModuleName.B` |
743+
| `Microflow` `Nanoflow` | Document ID | `ModuleName.DocumentName` |
731744

732745
#### Studio Pro UI
733746

0 commit comments

Comments
 (0)