Skip to content

Commit e0b7abb

Browse files
committed
Describe API usage Action Variables
1 parent 35c2074 commit e0b7abb

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

content/en/docs/apidocs-mxsdk/apidocs/frontend/pluggable-widgets/pluggable-widgets-client-apis/_index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ Note that `isExecuting` indicates only whether the current action is running. It
7474

7575
The method `execute` triggers the action. It returns nothing and does not guarantee that the action will be started synchronously. But when the action does start, the component will receive a new prop with the `isExecuting` flag set.
7676

77+
When the action property [defines action variables](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#action-xml-elements), the `execute()` method expects an object map containing a property for each variable. The variables may be undefined. Given an action property with variables as defined below, `execute()` accepts the following input:
78+
79+
```xml
80+
<actionVariables>
81+
<actionVariable key="lat" type="Decimal" caption="Latitude of selected location" />
82+
<actionVariable key="long" type="Decimal" caption="Longitude of selected location" />
83+
<actionVariable key="label" type="String" caption="Label of the selected location" />
84+
</actionVariables>
85+
```
86+
87+
```ts
88+
interface MapWidgetProps {
89+
onClick: ActionValue<{ lat: Option<number>, long: Option<number>, label: Option<string> }>
90+
}
91+
92+
onClick.execute({
93+
lat: 51.907,
94+
long: 4.488,
95+
label: undefined
96+
});
97+
```
98+
7799
### DynamicValue {#dynamic-value}
78100

79101
`DynamicValue` is used to represent values that can change over time and is used by many property types. It is defined as follows:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ When a `dataSource` attribute is specified and configured by the user, it is pas
487487
| `defaultValue` | No | String | Default value for the property, the format should be `<ModuleId>.<DocumentId>` |
488488
| `defaultType` | No | String | Default type for the property, supported values are `None`, `OpenPage`, `CallNanoflow`, `CallMicroflow` |
489489

490-
#### XML Elements
490+
#### XML Elements {#action-xml-elements}
491491

492492
`<actionVariables>` — Defines variables a widget provides when calling [`execute()` on an ActionValue](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis/#413-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.
493493

0 commit comments

Comments
 (0)