Skip to content

Commit df84724

Browse files
authored
Merge pull request mendix#9224 from mendix/revert-9210-wtf/action-variables
Revert "[WTF-2181] Action Variables"
2 parents 2c10d48 + 13cdcde commit df84724

3 files changed

Lines changed: 3 additions & 52 deletions

File tree

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

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,40 +56,24 @@ export interface ActionValue {
5656
}
5757
```
5858

59-
#### canExecute {#canexecute}
59+
#### 4.1.1 canExecute
6060

6161
The flag `canExecute` indicates if an action can be run under current conditions. This prevents executing actions that are not allowed by the app's security settings. User roles can be set in the microflows and nanoflows, allowing users to call them. For more information on user roles and security, see the [Module Security Reference Guide](/refguide/module-security/).
6262

6363
You can also employ this flag when using a **Call microflow** action triggering a microflow with a parameter. Such an action cannot be run until a parameter object is available, for example when a parent data view has finished loading. Attempting to `execute` an action that cannot be run will have no effect, and generates a debug-level warning message.
6464

6565
The exception to this behavior is when the `ActionValue` is returned by [`ListActionValue.get()`](/apidocs-mxsdk/apidocs/pluggable-widgets-client-apis-list-values/#listactionvalue). In this case, the flag will be true when not all arguments have been loaded. Calling `execute()` for an action with loading arguments will run the action as soon as all arguments become available. While waiting, `isExecuting` will be set to `true` and subsequent calls to `execute()` are ignored. If any arguments become unavailable after loading, the action will not run and a debug-level warning message will be logged.
6666

67-
#### isExecuting {#isexecuting}
67+
#### 4.1.2 isExecuting
6868

6969
The flag `isExecuting` indicates whether an action is currently running. A long-running action can take seconds to complete. Your component might use this information to render an inline loading indicator which lets users track loading progress. Often it is not desirable to allow a user to trigger multiple actions in parallel. Therefore, a component (maybe based on a configuration) can decide to skip triggering an action while a previous execution is still in progress.
7070

7171
Note that `isExecuting` indicates only whether the current action is running. It does not indicate whether a target nanoflow, microflow, or object operation is running due to another action.
7272

73-
#### execute {#execute}
73+
#### 4.1.3 execute
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 passed as undefined, but need to be set explicitly.
78-
79-
Given an action property that defines two `Decimal` variables `lat` and `long`, and a `String` variable named `label`, its `execute()` method accepts the following input:
80-
81-
```ts
82-
interface MapWidgetProps {
83-
onClick: ActionValue<{ lat: Option<Big>, long: Option<Big>, label: Option<string> }>
84-
}
85-
86-
onClick.execute({
87-
lat: new Big(51.907),
88-
long: new Big(4.488),
89-
label: undefined
90-
});
91-
```
92-
9377
### DynamicValue {#dynamic-value}
9478

9579
`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: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -487,23 +487,6 @@ 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 {#action-xml-elements}
491-
492-
`<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.
493-
494-
`<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:
495-
* `key` (required) — The identifier of the variable used in Studio Pro and the Pluggable Widgets API.
496-
* `type` (required) — The type of the value that the variable represents. Supported types and their corresponding Typescript type are listed in the table below.
497-
* `caption` (required) — A short description of the variable that is displayed in Studio Pro.
498-
499-
| Action Variable Type | Client Type |
500-
| -------------------- | --------- |
501-
| `String` | `string` |
502-
| `Integer` | `Big` |
503-
| `Decimal` | `Big` |
504-
| `DateTime` | `Date` |
505-
| `Boolean` | `boolean` |
506-
507490
#### Studio Pro UI
508491

509492
When the property is defined as follows:
@@ -519,22 +502,6 @@ Then the Studio Pro UI for the property appears like this:
519502

520503
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/action.png" class="no-border" >}}
521504

522-
When the action exposes variables with the following XML:
523-
524-
```xml
525-
<property key="actionWithVariable" type="action">
526-
<caption>On click</caption>
527-
<description>Action to be performed when button is clicked</description>
528-
<actionVariables>
529-
<actionVariable key="random" type="Decimal" caption="Random number between 0 and 1" />
530-
</actionVariables>
531-
</property>
532-
```
533-
534-
The variable appears in the UI like this:
535-
536-
{{< figure src="/attachments/apidocs-mxsdk/apidocs/pluggable-widgets/pluggable-widgets-property-types/action-variable.png" class="no-border" >}}
537-
538505
### Attribute {#attribute}
539506

540507
The attribute property type allows a widget to work directly with entities' attributes, both reading and writing attributes. Depending on the widget's purposes, a widget should define attribute types it supports.

0 commit comments

Comments
 (0)