You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/pluggable-widgets/_index.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,13 @@ A prop value is often not just a primitive value, but an object whose structure
43
43
44
44
```ts
45
45
exportinterfaceActionValue {
46
-
readonly canExecute:boolean;
47
-
readonly isExecuting:boolean;
48
-
execute():void;
46
+
readonly canExecute:boolean;
47
+
readonly isExecuting:boolean;
48
+
execute():void;
49
49
}
50
50
```
51
51
52
-
The above interface could be used this way: a component uses a `canExecute`flag to decide whether it should be enabled, uses an `isExecuting` flag to show an inline progress indicator, and triggers `execute()` method in a reaction to user click. Normally, after `execute()` has been triggered, the component will be re-rendered with a new value that has the `isExecuting` flag set, and when an action, for example a microflow, completes, the component is re-rendered again without `isExecuting`.
52
+
The above interface could be used this way: a component uses a `canExecute` flag to decide whether it should be enabled, uses an `isExecuting` flag to show an inline progress indicator, and triggers `execute()` method in a reaction to user click. Normally, after `execute()` has been triggered, the component will be re-rendered with a new value that has the `isExecuting` flag set, and when an action, for example a microflow, completes, the component is re-rendered again without `isExecuting`.
53
53
54
54
## Widget Package {#widget-package}
55
55
@@ -61,17 +61,17 @@ A widget package file is just a ZIP archive containing the following things:
61
61
62
62
* A *package.xml* file describing the whole package
63
63
* A widget definition XML file, preferably located in *{widgetName}.xml* where `widgetName` is the last part of widget [ID](#widget-id)
64
-
* A client component of a widget located, for example, in *com/mendix/widget/MyProgressCircle.js* for a widget with the ID `com.mendix.widget.MyProgressCircle`
64
+
* A client component of a widget located, for example, in *com/mendix/widget/MyProgressCircle.js* for a widget with the ID `com.mendix.widget.MyProgressCircle`
65
65
* Optionally, a widget preview Studio Pro’s **Design mode** located in *{widgetName}.editorPreview.js*
66
66
* Optionally, widget icons (which must be the PNG format):
67
-
**{widgetName}.icon.png* sets the widget icon inside the Studio Pro toolbox in list view (the ideal image size is 64x64 pixels, but other sizes will be resized to fit)
68
-
**{widgetName}.icon.dark.png* sets the dark-mode equivalent to *{widgetName}.icon.png*
69
-
**{widgetName}.tile.png* sets the tile image inside the Studio Pro toolbox in tile view (the ideal image size is 256x192 pixels, but other sizes will be resized to fit)
70
-
**{widgetName}.tile.dark.png* sets the dark-mode equivalent to *{widgetName}.tile.png*
67
+
**{widgetName}.icon.png* sets the widget icon inside the Studio Pro toolbox in list view (the ideal image size is 64x64 pixels, but other sizes will be resized to fit)
68
+
**{widgetName}.icon.dark.png* sets the dark-mode equivalent to *{widgetName}.icon.png*
69
+
**{widgetName}.tile.png* sets the tile image inside the Studio Pro toolbox in tile view (the ideal image size is 256x192 pixels, but other sizes will be resized to fit)
70
+
**{widgetName}.tile.dark.png* sets the dark-mode equivalent to *{widgetName}.tile.png*
71
71
* Optionally, some widget-related resources, preferably located next to the file which contains the client component
72
-
* Note that all CSS files you add (except the one located in the **lib** sub-directory) will automatically be loaded in an app via the widget
72
+
* Note that all CSS files you add (except the one located in the **lib** sub-directory) will automatically be loaded in an app via the widget
73
73
74
-
Naming your widget package file after the `widgetName` is best practice. Also, a widget package can include multiple widgets by putting several of the above items in the same widget package. However, creating such packages is *not recommended*.
74
+
Naming your widget package file after the `widgetName` is best practice. Also, a widget package can include multiple widgets by putting several of the above items in the same widget package. However, creating such packages is *not recommended*.
75
75
76
76
The *package.xml* file has the following structure:
77
77
@@ -124,9 +124,9 @@ Here is an example of a widget’s attributes section:
124
124
This section is generated based on options chosen while running the Mendix Pluggable Widget Generator. You will rarely need to modify it after it is generated. This sample widget features several widget attributes:
125
125
126
126
*`id`<aid="widget-id"></a> — This the fully qualified name of the widget called widget ID. Using widget ID, the Mendix Platform distinguishes widgets from each other. Widget ID should never be changed after a widget is used in an app or is published in the Marketplace. Reverse domain-style names, as in example above, are recommended.
127
-
*`pluginWidget` — This should always be set to `true`. This way, the Mendix Platform can distinguish between the newer pluggable widgets and the older custom widgets.
127
+
*`pluginWidget`— This should always be set to `true`. This way, the Mendix Platform can distinguish between the newer pluggable widgets and the older custom widgets.
128
128
*`offlineCapable` — This shows if a widget can work while an app is offline. For more information on offline apps, see the [Offline-First](/refguide/offline-first/) guide. A widget that fetches information from a third-party API, for example a widget that fetches airline ticket prices, could not function without an internet connection. If a widget cannot work offline, Mendix Studio Pro will forbid its use on pages that must be available offline.
129
-
*`supportedPlatform` — This shows the platforms a widget is compatible with. `Web` describes widgets that are only compatible with web and hybrid mobile apps. `Native` describes widgets that are compatible with native mobile apps.
129
+
*`supportedPlatform` — This shows the platforms a widget is compatible with. `Web` describes widgets that are only compatible with web and hybrid mobile apps. `Native` describes widgets that are compatible with native mobile apps.
130
130
131
131
### Widget Description {#widget-description}
132
132
@@ -387,7 +387,7 @@ Some properties can or must have more attributes or tags. This depends on the `t
387
387
388
388
*`key`<aid="key-attribute"></a> — This element is a property's unique, single-word identifier. The `key` elements are used internally to identify properties, so they should never change after a widget is used in an app or is published in the Marketplace. A `key` element also identifies a property value when it is passed to a pluggable widget’s client component.
389
389
*`type`<aid="type-attribute"></a> — This element is a property's type. The `type` element defines which values can be configured for a property, which UI is used in the Mendix Studio Pro, and what type of value a pluggable widget’s client component receives.
390
-
*`caption` — This element is a short label identifying a property to a modeling developer. The first letter of a caption should be capitalized.
390
+
*`caption` — This element is a short label identifying a property to a modeling developer. The first letter of a caption should be capitalized.
391
391
*`description` — This element is a longer description of a property. A description should be capitalized and limited to one or two sentences.
392
392
393
393
Here is how a caption and description look in Studio Pro:
0 commit comments