Skip to content

[WTF-2318]: Default Parameter Argument Mappings #9842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Client APIs"
linktitle: "Client APIs for Pluggable Widgets"
url: /apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/
description: A guide for understanding the client APIs available to pluggable widgets in Mx10.
description: A guide for understanding the client APIs available to pluggable widgets.
weight: 20
aliases:
- /apidocs-mxsdk/apidocs/client-apis-for-pluggable-widgets
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "List Values"
url: /apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/
description: A guide to understanding the list of objects for the datasource property in Mx10.
description: A guide to understanding the list of objects for the datasource property.
---

## Introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,14 @@ Then the Studio Pro UI for the property appears like this:

### Action {#action}

{{% alert color="info" %}}
The `defaultType` and `defaultValue` attributes for Action were introduced in Mendix [10.15](/releasenotes/studio-pro/10.15/).
{{% /alert %}}

The action property type allows a user to configure an action which can do things like call nanoflows, save changes, and open pages.

If a `dataSource` attribute is not specified, the client will receive an `ActionValue` representing the action or `undefined` if the **Do nothing** action was selected.
If a `dataSource` attribute is not specified, the client will receive an [`ActionValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#actionvalue) representing the action or `undefined` if the **Do nothing** action was selected.

When a `dataSource` attribute is specified and configured by the user, it is passed as a [`ListActionValue`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listactionvalue). For more information, see the [Datasource](#datasource) section below.

Action properties can be preconfigured using the `defaultValue` and `defaultType` attributes. This is particularly useful when the widget is intended to be used with a specific microflow, nanoflow, or page. When the property [exposes action variables](#action-xml-elements), they are automatically mapped to parameters of matching name and type.

#### XML Attributes {#xml-attributes}

| Attribute | Required | Attribute Type | Description |
Expand All @@ -489,7 +487,7 @@ When a `dataSource` attribute is specified and configured by the user, it is pas

#### XML Elements {#action-xml-elements}

`<actionVariables>` — Defines variables a widget provides when calling [execute() on an ActionValue](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#execute). The variables are made available in Studio Pro when configuring [Call a Microflow](/refguide/on-click-event/#call-microflow) and [Call a Nanoflow](/refguide/on-click-event/#call-nanoflow) actions.
`<actionVariables>` — Defines variables a widget provides when calling [execute() on an ActionValue](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#execute). The variables are made available in Studio Pro when configuring [Call a Microflow](/refguide/on-click-event/#call-microflow) and [Call a Nanoflow](/refguide/on-click-event/#call-nanoflow) actions. Action variables are automatically mapped to parameters of the same name (`key`) and type.

`<actionVariable>` (required one or more) — Represents a primitive value provided by the widget as an argument when calling `ActionValue.execute()`. The variable is defined by the following attributes:

Expand Down Expand Up @@ -747,10 +745,6 @@ Only list datasources are supported, therefore specifying `isList="true"` is req

##### Data Source Defaults {#data-source-defaults}

{{% alert color="info" %}}
The `defaultType` and `defaultValue` attributes for datasources were introduced in Mendix [10.16](/releasenotes/studio-pro/10.16/).
{{% /alert %}}

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.

The format of `defaultValue` depends on the chosen `defaultType`:
Expand All @@ -777,10 +771,6 @@ Then the Studio Pro UI for the property appears like this:

### Selection {#selection}

{{% alert color="info" %}}
The property type was introduced in Mendix [10.7](/releasenotes/studio-pro/10.7/).
{{% /alert %}}

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.

#### XML Attributes
Expand Down Expand Up @@ -847,10 +837,6 @@ Label property allows a pluggable widget to have labeling functionality similar

#### setLabel {#setLabel}

{{% alert color="info" %}}
The `setLabel` attribute was introduced in Mendix [10.5](/releasenotes/studio-pro/10.5/).
{{% /alert %}}

You can use `setLabel` to specify which properties can be used to set the `Label` property value.

Configuring the value of a property with the `setLabel` attribute will automatically update the value of `Label`.
Expand Down
6 changes: 2 additions & 4 deletions content/en/docs/refguide/modeling/pages/on-click-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ This duplicates the [Microflow](#microflow) specified above.

##### Microflow Arguments

**Microflow arguments** are automatically configured based on the parameters of the selected microflow and the available arguments. In general arguments are taken from any enclosing data widget. If the data widget enclosing the widget calling a microflow is inside another (nested) data widget, then objects from that data widget and any others in which it is nested can also be passed.

If the microflow is triggered within a grid and has an object list parameter, the objects which are passed in the list depend on the selection mode of the grid. Simple multi-selection allows for either all rows or selection, and defaults to selection. This can be configured via the drop-down menu in the microflow settings page. A grid with single selection always passes all rows to the microflow.
**Microflow arguments** specify the values that are passed as parameters when the microflow is called. Each argument can be defined using an expression or by choosing a variable that is available on the page. Variables are exposed by the widget itself, surrounding data widgets, a widget with selection, page variables, and page parameters. When the [**Microflow**](#microflow) is set, arguments are automatically filled for parameters with clear candidate variables. For example, because the name of the variable matches that of the parameter, or only one variable of the parameter's type is available.

##### Microflow Call Type

Expand Down Expand Up @@ -224,7 +222,7 @@ Set the **Nanoflow** property to specify a [nanoflow](/refguide/nanoflow/) that

You can either select an existing nanoflow or create a new nanoflow by clicking the **New** button from the **Select Nanoflow** dialog box.

When creating a new nanoflow, a dialog box is shown where you can set the name and select parameters for the new nanoflow. You can choose the data view, snippet, page parameter, or available selection from which the parameter must be created in the new nanoflow.
**Nanoflow arguments** specify the values that are passed as parameters when the nanoflow is called. Each argument can be defined using an expression or by choosing a variable that is available on the page. Variables are exposed by the widget itself, surrounding data widgets, a widget with selection, page variables, and page parameters. When the **Nanoflow** is set, arguments are automatically filled for parameters with clear candidate variables. For example, because the name of the variable matches that of the parameter, or only one variable of the parameter's type is available.

If there is nothing to pass to the new nanoflow, then a dialog box is shown where you can only specify the name of the nanoflow.

Expand Down