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/extensibility-api/web/web-extensions-howtos/dialog-api.md
+58-1Lines changed: 58 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,6 +230,7 @@ To show a progress dialog, call the method `studioPro.ui.dialogs.showProgressDia
To see how `resolveImmediatelyOnCancel` influences the result, consider a modified version of the example above that sets a value twice per step into a dictionary called `state`. By default (when `resolveImmediatelyOnCancel` is omitted), the canceled step finishes executing and the result has a value of `2` for the dictionary entry set at that step.
320
+
321
+
To capture the state before the canceled step completes, pass `true` for `resolveImmediatelyOnCancel`. The `state` dictionary then contains a value of `1` instead of `2` for the canceled step.
322
+
323
+
```typescript
324
+
const state: { [step:string]:number } = {};
325
+
326
+
const step1:ProgressDialogStep= {
327
+
title: "Step 1",
328
+
description: "Executing Step 1",
329
+
action: async () => {
330
+
// perform action
331
+
state["step1"] =1;
332
+
// other things happening...
333
+
awaitsleep(5000);
334
+
state["step1"] =2;
335
+
returntrue;
336
+
}
337
+
};
338
+
339
+
const step2:ProgressDialogStep= {
340
+
title: "Step 2",
341
+
description: "Executing Step 2",
342
+
action: async () => {
343
+
// perform action
344
+
state["step2"] =1;
345
+
// other things happening...
346
+
awaitsleep(5000);
347
+
state["step2"] =2;
348
+
349
+
returntrue;
350
+
}
351
+
};
352
+
353
+
const step3:ProgressDialogStep= {
354
+
title: "Step 3",
355
+
description: "Executing Step 3",
356
+
action: async () => {
357
+
// perform action
358
+
state["step3"] =1;
359
+
// other things happening...
360
+
awaitsleep(5000);
361
+
state["step3"] =2;
362
+
returntrue;
363
+
}
364
+
};
365
+
366
+
const resolveImmediatelyOnCancel =true;
367
+
const result =awaitstudioPro.ui.dialogs.showProgressDialog("Cancel This Progress", [step1, step2, step3], resolveImmediatelyOnCancel);
368
+
369
+
if (result.result==="Success") awaitstudioPro.ui.messageBoxes.show("info", "Process completed successfully");
370
+
if (result.result==="UserCancelled") awaitstudioPro.ui.messageBoxes.show("info", "Process was cancelled. Result: "+JSON.stringify(state));
371
+
```
372
+
316
373
Mendix recommends wrapping your step action body in a `try/catch` block so you can control the error that is returned to the user:
Copy file name to clipboardExpand all lines: content/en/docs/releasenotes/studio-pro/web-extensibility-api.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,12 @@ numberless_headings: true
8
8
9
9
These release notes cover changes to the [Extensibility API for Web Developers](/apidocs-mxsdk/apidocs/extensibility-api/).
10
10
11
+
## Version 11.12.2
12
+
13
+
* We fixed a bug where the Extensions Overview page would not open if the user was not signed in.
14
+
* We fixed a bug where reloading a Dev extension would cause a crash if extension tabs were still open.
15
+
* We fixed an issue where progress dialogs did not behave like their C# counterpart. Canceling a step now waits for it to finish and return its result. To exit the step and return its result immediately on cancel, pass `resolveImmediatelyOnCancel` to `IDialogApi.showProgressDialog`.
16
+
11
17
## Version 11.12.1
12
18
13
19
* We removed timeouts for Custom Blob Document consistency checks instead of showing a generic error in the **Errors** pane. We also added analytics to identify extensions that exceed the previous timeout.
0 commit comments