expressappframework-402158-getting-started-in-depth-tutorial-blazor-add-actions-menu-commands-add-an-action-that-displays-a-pop-up-window.md
This lesson explains how to create an Action that shows a pop-up window. This type of Action is useful when users want to input multiple parameters in a pop-up dialog before they execute an Action.
Note
Before you proceed, take a moment to review the previous lessons:
In this tutorial, you will implement the ability to add notes from a predefined list to task descriptions.
Expand the MySolution.Module project and right-click the Business Objects folder. Choose Add | Class…. Specify Note.cs as the new class name and click Add.
Replace the generated class declaration with the following code snippet:
Register the Note type in DbContext. Edit the BusinessObjects\MySolutionDbContext.cs file as shown below:
Add a new View Controller to the MySolution.Module project. Name it PopupNotesController.
In the PopupNotesController.cs file, specify the controller properties:
Add the ShowNotesAction action and handle its CustomizePopupWindowParams event:
Add and handle the ShowNotesAction‘s Execute event. It occurs when a user clicks OK in the pop-up window. The event handler code appends the Note.Text property value to the Task.Description property value.
Run the application.
For an example of how to create and show a Detail View, refer to the following topic: How to: Create and Show a Detail View of the Selected Object in a Popup Window.
Note
CodeRush allows you to add Actions and Controllers with a few keystrokes. To learn about the Code Templates for XAF , refer to the following help topic: XAF Templates.
Add an Action with Option Selection
See Also
Create, Read, Update and Delete Data
Controllers (UI Logic & Interaction)
How to: Adjust the Size and Style of Pop-up Dialogs (Blazor)