Skip to content

Commit 3399839

Browse files
committed
Merge branch 'mendix-11' into yl-remove-or-update-Mendix-10-instances
2 parents 263f99c + 347dd04 commit 3399839

135 files changed

Lines changed: 1859 additions & 607 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/en/docs/apidocs-mxsdk/apidocs/frontend/design-properties.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Here is an example of a **Colorpicker** design property using classes:
237237
```js
238238
{
239239
"name": "Background color",
240-
"type": "Colorpicker",
240+
"type": "ColorPicker",
241241
"description": "Description of Background color Property",
242242
"options": [
243243
{
@@ -261,7 +261,7 @@ Here is an example of a **Colorpicker** design property using CSS variables:
261261
```js
262262
{
263263
"name": "Background color",
264-
"type": "Dropdown",
264+
"type": "ColorPicker",
265265
"property": "background-color",
266266
"description": "Description of Background Color Property",
267267
"options": [
@@ -281,7 +281,9 @@ Here is an example of a **Colorpicker** design property using CSS variables:
281281
}
282282
```
283283

284-
Note: if you can not provide a value for the preview, it is recommended to instead use a **Dropdown** design property. If at a later point in time you can provide the preview, you can always change the type from a **Dropdown** to a **Colorpicker**.
284+
If no preview is specified, the value of the CSS variable will be used by default. Therefore, you can omit the preview property if your design property is based on CSS variables. However, if your design property is based on classes, it is recommended to provide a preview.
285+
286+
You can always change the type from a **Colorpicker** to a **Dropdown** if needed.
285287

286288
This is how the **Colorpicker** design property appears:
287289

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

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

59-
#### 4.1.1 canExecute
59+
#### canExecute {#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-
#### 4.1.2 isExecuting
67+
#### isExecuting {#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-
#### 4.1.3 execute
73+
#### execute {#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+
7793
### DynamicValue {#dynamic-value}
7894

7995
`DynamicValue` is used to represent values that can change over time and is used by many property types. It is defined as follows:
@@ -105,7 +121,7 @@ Though the type definition above looks complex, it is fairly simply to use becau
105121

106122
### EditableValue {#editable-value}
107123

108-
`EditableValue` is used to represent values that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
124+
`EditableValue` is used to represent values, either an attribute or a variable, that can be changed by a pluggable widget client component and is passed only to [attribute properties](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute). It is defined as follows:
109125

110126
```ts
111127
export interface EditableValue<T extends AttributeValue> {
@@ -135,15 +151,15 @@ The flag `readOnly` indicates whether a value can actually be edited. It will be
135151

136152
The value can be read from the `value` field and modified using `setValue` function. Note that `setValue` returns nothing and does not guarantee that the value is changed synchronously. But when a change is propagated, a component receives a new prop reflecting the change.
137153

138-
When setting a value, a new value might not satisfy certain validation rules — for example a value might be bigger that the underlying attribute allows. In this case, your change will affect only `value` and `displayValue` received through a prop. Your change will not be propagated to an object’s attribute and will not be visible outside of your component. The component will also receive a validation error text through the `validation` field of `EditableValue`.
154+
When setting a value, a new value might not satisfy certain validation rules — for example when an attribute is selected and the new value is bigger than the underlying attribute allows. In this case, your change will affect only `value` and `displayValue` received through a prop. Your change will not be propagated to an object’s attribute and will not be visible outside of your component. The component will also receive a validation error text through the `validation` field of `EditableValue`.
139155

140156
It is possible for a component to extend the defined set of validation rules. A new validator — a function that checks a passed value and returns a validation message string if any — can be provided through the `setValidator` function. A component can have only a single custom validator. The Mendix Platform ensures that custom validators are run whenever necessary, for example when a page is being saved by an end-user. It is best practice to call `setValidator` early in a component's lifecycle — specifically in the [componentDidMount](https://en.reactjs.org/docs/react-component.html#componentdidmount) function.
141157

142-
In practice, many client components present values as nicely formatted strings which take locale-specific settings into account. To facilitate such cases `EditableValue` exposes a field `displayValue` formatted version of `value`, and a method `setTextValue` — a version of `setValue` that takes care of parsing. `setTextValue` also validates that a passed value can be parsed and assigns the target attribute’s type. Similarly to `setValue`, a change to an invalid value will not be propagated further that the prop itself, but a `validation` is reported. Note that if a value cannot be parsed, the prop will contain only a `displayValue` string and `value` will become undefined.
158+
In practice, many client components present values as nicely formatted strings which take locale-specific settings into account. To facilitate such cases `EditableValue` exposes a field `displayValue` which is the formatted version of `value`, and a method `setTextValue` — a version of `setValue` that takes care of parsing. `setTextValue` also validates that a passed value can be parsed and assigned to the target's value type. Similarly to `setValue`, a change to an invalid value will not be propagated further than the prop itself, but a `validation` is reported. Note that if a value cannot be parsed, the prop will contain only a `displayValue` string and `value` will become undefined.
143159

144160
There is a way to use more the convenient `displayValue` and `setTextValue` while retaining control over the format. A component can use a `setFormatter` method passing a formatter object: an object with `format` and `parse` methods. The Mendix Platform provides a convenient way of creating such objects for simple cases. An existing formatter exposed using a `EditableValue.formatter` field can be modified using its `withConfig` method. For complex cases formatters still can be created manually. A formatter can be reset back to default settings by calling `setFormatter(undefined)`.
145161

146-
The optional field `universe` is used to indicate the set of all possible values that can be passed to a `setValue` if a set is limited. Currently, `universe` is provided only when the edited attribute is of the Boolean or enumeration [types](/refguide/attributes/#type).
162+
The optional field `universe` is used to indicate the set of all possible values that can be passed to a `setValue` if a set is limited. Currently, `universe` is provided only when the edited value is of the Boolean or enumeration [types](/refguide/attributes/#type).
147163

148164
### ModifiableValue {#modifiable-value}
149165

@@ -192,7 +208,7 @@ It is possible for a component to extend the defined set of validation rules. A
192208

193209
### IconValue {#icon-value}
194210

195-
`DynamicValue<IconValue>` is used to represent icons: small pictograms in the Mendix Platform. Those can be static or dynamic file- or font-based images. An icon can only be configured through an [icon](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#attribute) property. `IconValue` is defined as follows:
211+
`DynamicValue<IconValue>` is used to represent icons: small pictograms in the Mendix Platform. Those can be static or dynamic file- or font-based images. An icon can only be configured through an [icon](/apidocs-mxsdk/apidocs/pluggable-widgets-property-types/#icon) property. `IconValue` is defined as follows:
196212

197213
```ts
198214
interface GlyphIcon {

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

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Then the Studio Pro UI for the property appears like this:
134134

135135
Integer is represented as a number input in Studio Pro. It is passed as a `number` prop to a client component.
136136

137-
#### XML Attributes
137+
#### XML Attributes
138138

139139
| Attribute | Required | Attribute Type | Description |
140140
|----------------|----------|----------------|--------------------------------|
@@ -477,7 +477,7 @@ If a `dataSource` attribute is not specified, the client will receive an `Action
477477

478478
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.
479479

480-
#### XML Attributes
480+
#### XML Attributes {#xml-attributes}
481481

482482
| Attribute | Required | Attribute Type | Description |
483483
|----------------|----------|----------------|---------------------------------------------------------------------------------------------------------|
@@ -487,6 +487,23 @@ 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+
490507
#### Studio Pro UI
491508

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

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

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+
505538
### Attribute {#attribute}
506539

507540
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.

content/en/docs/appstore/create-content/create-connectors/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This chart shows the available solutions for when you want to connect Mendix app
4545

4646
| Category | Solution |
4747
| --- | --- |
48-
| Platform-supported protocols | Connect to two or more Mendix applications using platform-supported facilities:<br> SOAP web services (see [Published Web Services](/refguide/published-web-services/) and [Consumed Web Services](/refguide/consumed-web-services/)), REST web services (see [Published REST Services](/refguide/published-rest-service/) and [Consumed REST Services](/refguide/consumed-rest-services/)), OData (see [Published OData Services](/refguide/published-odata-services/) and [Consumed OData Services](/refguide/consumed-odata-services/)), or Catalog (see the [Catalog Guide](/catalog/)). |
48+
| Platform-supported protocols | Connect to two or more Mendix applications using platform-supported facilities:<br> SOAP web services (see [Published Web Services](/refguide/published-web-services/) and [Consumed Web Services](/refguide/consumed-web-services/)), REST web services (see [Published REST Services](/refguide/published-rest-service/) and [Consumed REST Service](/refguide/consumed-rest-service/)), OData (see [Published OData Services](/refguide/published-odata-services/) and [Consumed OData Services](/refguide/consumed-odata-services/)), or Catalog (see the [Catalog Guide](/catalog/)). |
4949
| Unsupported protocols | Build a module to connect either with alternative protocols or by encapsulating one of the platform supported protocols. You can do this with [Java actions](/refguide/java-actions/) or [JavaScript actions](/refguide/javascript-actions/). |
5050

5151
#### Connecting Mendix Apps to Third-Party Systems

0 commit comments

Comments
 (0)