Skip to content

Commit 9c82d33

Browse files
committed
Modal
1 parent d20c91e commit 9c82d33

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/csharp/extensibility-api-howtos

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-10/extensibility-api/csharp/extensibility-api-howtos/create-modal-web-view.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ weight: 7
77

88
## Introduction
99

10-
This how-to describes how you can create a new web view hosted inside a modal dialog. You will then open the modal from a new menu item.
10+
This how-to describes how to create a new web view hosted inside a modal dialog, and how to open the modal from a new menu item.
1111

1212
You can download the example in this how-to in [this GitHub repository](https://github.com/mendix/ExtensionAPI-Samples)
1313

1414
## Adding a View Model for Your New Modal
1515

16-
Add a view model for your new model. The view model takes care of the messages and the overall lifecycle of the modal web view.
16+
Create a view model for your new model to manage the lifecycle and messaging of the modal web view.
1717

1818
```csharp
1919
namespace MyCompany.MyProject.MendixExtension;
@@ -55,7 +55,7 @@ class MyModalWebViewViewModel(
5555

5656
## Adding a Controller Class
5757

58-
You are creating a controller to delegate specific tasks, allowing you to keep the menu item free of unrelated business logic, for instance, conducting basic setup and displaying the web view. This approach is recommended, but not mandatory.
58+
Create a controller to delegate tasks, allowing you to keep the menu item free of unrelated business logic (for example, conducting basic setup and displaying the web view). This approach is recommended, but not mandatory.
5959

6060
{{% alert color="info" %}}
6161
Specify both `Height` and `Width` properties; otherwise, they will default to 0,0.
@@ -82,7 +82,7 @@ class MyModalWebViewController(IDialogService dialogService, IMessageBoxService
8282

8383
## Adding a Content Server
8484

85-
To open static pages, you need to source them from either a file system path or via the `WebServerExtension` route. This document covers the latter, as this is the preferred way to provide static web content to an extension.
85+
Use the `WebServerExtension` route to provide static web content to the extension.
8686

8787
```csharp
8888
namespace MyCompany.MyProject.MendixExtension;
@@ -150,7 +150,7 @@ class ContentServer : WebServerExtension
150150

151151
## Adding a Menu Item That Opens the Modal Dialog
152152

153-
Finally, you need to add a menu item to open the dialog. Replace the contents of `MyMenuExtension.cs` with the code below:
153+
Replace the contents of `MyMenuExtension.cs` with the code below to add a menu item to open the dialog:
154154

155155
```csharp
156156
namespace MyCompany.MyProject.MendixExtension;
@@ -166,6 +166,8 @@ class MyMenuExtension(MyModalWebViewController myModalWebViewController) : MenuE
166166
}
167167
```
168168

169-
These changes inject your new controller class into the `MyMenuExtension` class. Then you add a new menu item called `Create Entity From Dialog` and call the controller's `ShowDialog` method.
169+
This code injects your controller class into the `MyMenuExtension` class. It adds a new menu item called `Create Entity From Dialog` and calls the controller's `ShowDialog` method.
170170

171-
Note that in this example, the parameter `currentApp` will be necessary, if the dialog needs to interact with the model. Additionally, `WebServerBaseUrl` is crucial, because, without the base path, navigating to the route you defined in the web server extension would not be possible.
171+
{{% alert type="info" %}}
172+
In this example, the `currentApp` parameter is required if the dialog needs to interact with the model. Additionally, `WebServerBaseUrl` is crucial; without the base path, navigating to the route defined in the web server extension would not be possible.
173+
{{% /alert %}}

0 commit comments

Comments
 (0)