Creating a Popup Screen in LightSwitch
For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.
In this lesson, you’ll learn how to how to create a Popup in a LightSwitch application.
Creating a Popup
You can use the Screen Designer to create a Popup, which is a floating window that appears on top of the active screen.
To add a Popup
In Solution Explorer, open the shortcut menu for the BrowseOrders.lsml node, and then choose Open.
In the center pane of the Screen Designer, choose the Popup node, and then choose the Add Popup node.
A new Popup is added to the screen.
Choose the Rows Layout | Group (Popup) node. In the Properties window, choose the Name property, and then enter
Select the check box for the Use Read-only Controls property.
In the Screen Designer, choose the Rows Layout | Order Information (Popup) node, open the Rows Layout list, and then choose Columns Layout.
Open the Add list, and then choose – Selected Item.
Choose the Columns Layout | Order Information (Popup) node, open the Add list, and then choose New Group.
A Rows Layout | Group node is added.
Choose the Ship Name, Ship Address, Ship City, Ship Region, Ship Postal Code, and Ship Country nodes and drag them to the Rows Layout | Group node.
Choose the Table | Orders node. In the Properties window, choose the Item Tap: viewSelected link.
In the Edit ItemTap Action dialog box, open the Orders.viewSelected list. Choose showPopup, and then choose the OK button.
Run the application. Open the Browse Orders screen, and then choose an order to display the Popup.
Choose the Browse Orders screen to dismiss the Popup, and then close the application.
In an earlier lesson you created an Add/Edit Details screen for the Contacts entity. That screen is a modal dialog box that blocks access to the underlying screen until the user taps the Save or Cancel button to dismiss the dialog box. In LightSwitch, a Popup is similar to a modal dialog box, but it’s dismissed by tapping anywhere outside of it. You can create multiple Popups for any screen, but you can’t share them between screens.
In this example you set the item tap action for the screen to show the Popup, replacing the previous action that launched the ViewOrder screen. Instead of replacing the existing action, you could have added a button on the toolbar to launch the Popup.
In the next lesson, you’ll learn how to use a screen property to display information on a screen.
Next lesson: Displaying Local Information