Building a pop-up screen

This recipe will show how a pop-up screen can be created within a dashboard. Such a pop-up screen can, for example, be used to provide additional information related to the content of the dashboard. In this recipe, the pop-up screen can be activated and deactivated by clicking on buttons.

Getting ready

No specific preparation is needed for this recipe. You can use any dashboard you already created or just start with an empty one. In this example, we will use the dashboard from the previous recipe.

How to do it...

  1. Drag a Background component into the canvas from the Art and Backgrounds category.
    How to do it...
  2. Drag the Label component from the Text category, place it on top of the Background component, and enter some text:
    How to do it...
  3. Now, drag a Push Button component from the Selectors category into the canvas and position it in the upper right-hand side corner of the Background component. Rename its label as Close. We will use this button to close the pop-up screen:
    How to do it...
  4. Set up the spreadsheet. Enter value 1 in cell E1 and value 0 in cell E2:
    How to do it...
  5. Bind the Source Data field in the Push Button component properties to spreadsheet cell E2 and bind the Destination field to cell E3:
    How to do it...
  6. Group the three components (see the Grouping the canvas components recipe in Chapter 1, Staying in Control).
  7. Add another Push Button component to the canvas and rename its label Info. This button will be used to activate the pop-up screen.
  8. Bind the Source Data field of this second Push Button component to spreadsheet cell E1 and bind the Destination field to cell E3:
    How to do it...
  9. Now we are ready to set up the Dynamic Visibility functionality. Select the grouped components and go to the properties pane. You will see only one Common tab now. Bind the Status field to spreadsheet cell E3. Also, enter the value 1 in the Key field:
    How to do it...
  10. Preview the dashboard to test the functionality!
    How to do it...

How it works...

In this recipe, we combined the Push Button functionality with Dynamic Visibility. The three grouped components are only visible when the Dynamic Visibility status is 1 (spreadsheet cell E3). When clicking on the Info push button, the value 1 is put into spreadsheet cell E3, following which the grouped components appear. After clicking on the Close push button, the value 0 is put into this cell and the grouped components disappear as the status cell does not match value 1 anymore.

There's more...

After clicking on the Info push button, the pop-up screen appears. Now this button does not have any useful functionality. Nothing happens if you click it as the pop-up screen is already active. To make this button disappear, you can easily use the Dynamic Visibility functionality you already set up by following these steps:

  1. Go to the Behavior tab of the Info push button properties pane.
  2. Bind the Status field to spreadsheet cell E3 and enter value 0 into the Key field.
    There's more...
  3. Now preview the dashboard to see the effect.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset