🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
PopUp action
This page was created by Hans.karlsen on 2021-01-10. Last edited by Wikiadmin on 2026-07-29.

You can use a PopUp action to show additional ViewModel content without navigating away from the current view; use it when users need supporting information or a small task, not a forced decision.

Choose the presentation that matches the task

An action can open another view. Configure the view to be shown as a popup when the additional content should be available temporarily while the user remains in the originating view.

Presentation Use it when User interaction Change handling
Modal The user must make an explicit decision before continuing. The modal overlay must be closed with OK or Cancel. The modal provides the OK/Cancel interaction boundary.
PopUp You need more information, controls, or logic in a compact temporary area. It has no header and no OK or Cancel buttons. The user can dismiss it by clicking outside the popup. Changes are submitted to the underlying view. Put any cancel behavior on the originating view.
In-place popup A button should reveal content already defined in the same ViewModel, such as a compact list, a grid, or action groups. Pressing the button reveals the nested content as a popup. The content belongs to the same ViewModel definition; design its actions and changes in that context.

Create a standard popup

Use a standard popup when the popup needs its own ViewModel and can contain independent content and logic.

  1. Create a ViewModel for the content you want to show. For example, create a ViewModel rooted in Sled that shows the sled registration number and its boxes.
  2. Add the required nestings and presentation to that ViewModel. A standard popup can contain more than a small set of controls; it can do whatever its ViewModel is designed to do.
  3. Create an action that opens this ViewModel.
  4. Configure the action's shown view as Is PopUp.
  5. In the originating ViewModel, add an action button and configure it to execute the action that opens the popup.
  6. Run the application and verify that the user can dismiss the popup by clicking outside it.

For example, an AutoFormSled view can contain a Show sled details button. The button executes an action that opens PopupSled, a separate ViewModel rooted in the current Sled. PopupSled can display the registration number and a nested list of boxes.

Design for submitted changes

A popup does not have its own Cancel button. It always submits changes to the underlying view. Do not use a popup where users must explicitly accept or reject edits before anything continues; use a modal view for that decision flow instead.

For example, use a popup to expose a compact address list or related details. If editing the address must be accepted or discarded as a single decision, open that editor as a modal view rather than as a popup.

Create an in-place popup

An in-place popup is a lightweight popup defined in one ViewModel. Use it to keep content hidden until the user asks for it, without creating a separate popup ViewModel.

  1. Open the ViewModel that contains the content.
  2. Add the button that will reveal the content.
  3. Add a nesting to that button.
  4. Place the content to reveal inside the button's nesting.
  5. Configure the nesting to render as an action. When the user presses the button, the content in that nesting is rendered as a popup.
  6. Test the layout with the intended content and screen sizes.

For example, a sled form may normally show only a Show boxes button. Put the boxes grid in the button's nesting and render that nesting as an action. The boxes grid is then shown only after the user presses Show boxes, which saves space in the form.

An in-place popup can contain different nesting types, not only grids. For example, you can reveal a single linked object with its registration number, or present groups of available actions under headings in a compact popup.

= Layout and scrolling

An in-place popup is positioned outside the normal document flow. Large popup content can therefore require explicit layout handling.

  • If the content must scroll, make the popup content scrollable and set an appropriate maximum height. For example, a maximum height of 300 can constrain a long list in the demonstrated layout.
  • The outer placing container affects whether overflow is hidden or scrollable. Test this deliberately; overflow behavior can otherwise hide content or cause the surrounding view to scroll unexpectedly.
  • Avoid nesting popups inside popups unless you have tested the resulting interaction. When content needs a more independent or complex interaction, use a standard popup with a separate ViewModel.

Show actions close to the current task

An in-place popup is useful for exposing actions that would otherwise be available only in a side or left menu. For example, place a Show actions button near a selected record and use the popup nesting to present action groups where the user is working.

When you use placing containers, you are responsible for making the relevant object current and selecting it before invoking its actions. If you want the framework action menu for the current object in a nesting, use ShowActionMenuForCurrentInNesting.

If a popup button must invoke a ViewModel action programmatically, use ExecuteAction. That operator executes an action regardless of its visible or enabled expression, so your OCL or EAL must enforce any required enable rules.

Use the right action scope

The popup presentation controls how a view is displayed; it does not change the scope of the action it invokes.

  • Use a ViewModel action when the operation depends on the current ViewModel state, such as vCurrent or vSelected.
  • Use a class action when the operation belongs to the model object and should be available wherever that class is shown. A class action cannot use ViewModel vCurrent or vSelected variables.

See also