How to allow users to pick a value from a list in an overlay pop-up
You can configure buttons, icons, links, and text input controls to launch local actions in an overlay, a panel that overlays the current window. Overlays can display lists, charts, and reports. Users can set and change values in an overlay. Overlays do not require user input — the user can dismiss an overlay by clicking outside the overlay area or through an explicit Close action.
This article describes how to configure overlays to filter a list of colleges as the user types and enable a user to select a value from the list using the keyboard or mouse.
To interact with a sample, select > User Interface > UI Gallery , and select Combinations > Search And Select > Using Overlay.
In a student loan application, you may want to enable a user to select a college from a list. You may want to include multiple columns in this list; for example, the university name, logo, state, etc., and filter this list as the user types.
To do this, follow these steps:
- Create a report definition rule containing the data that you want to display in the overlay.
- Create a section containing a repeating grid sourced from the report definition.
- Create a flow action that includes the section you created.
- Configure the text input control to launch the flow action in an overlay.
Create a Report Definition rule that contains the data you want to display in the overlay. For information and videos that demonstrate creating report definitions, see Reporting in V6.2 — Nine tutorial videos.
- Define a report definition containing the properties, functions, or expressions that you want to include as columns in the report. In this case, the report definition,
Universities, contains properties such as
- Define filtering conditions that determine which class instances are to be included as rows in the report. (In this case, the report definition is filtered on the
- Save the Report Definition rule.
Create a section containing the information that you want to display in the overlay. In this case, the section contains a repeat grid sourced from the
Universities report definition rule. This grid is configured to display two columns, one column containing the name of the university and another displaying the university logo. See How to add a Grid layout to a section.
- Create a new section. On the Pages & Classes tab, add
pyWorkPageof your application class, in this case,
- Add a repeating grid bound to the Report Definition rule, in this case,
Universities. See How to add a Grid layout to a section.
- Specify the value of the Report Definition parameter as
.SelectCollegeName. The report definition is filtered on the
- In the Repeat Grid, add columns for
- Remove the column heading and clear the Make Header? checkbox setting on the first row of the grid.
- Delete the Add/Delete row from the Action Top area of the grid and delete all empty columns in the grid.
- Click the to open the Repeat Grid panel and then click the beside the Read Only Edit Mode to configure the following grid events and actions:
- Click and add the following Click events:
Event Action Behavior dialog Click Handle List Items > Set Focus
Display > Set Value
Click Advanced > Run Data Transform Click Display > Close
- Add the following Keyboard events:
Event Action Behavior dialog Keyboard - Up Handle List Items ->Set Focus
Keyboard - Down
Handle List Items ->Set Focus
Keyboard - Enter Display > Set Value Keyboard - Enter Advanced > Run Data Transform Keyboard - Enter Display > Close
- Click OK on the Parameters dialog and then save the section rule.
- Create a new flow action that references the section that you just created, in this case,
- On the Action tab of the flow action, clear the Hide the default Action section buttons? checkbox in the Action Buttons area. This hides the OK and Cancel buttons; they do not display in the overlay.
- Save the flow action.
- In the section in which you want to add the overlay, add a SmartLayout.
- Add the
.SelectCollegeNameproperty to the layout as a Text Input control.
- Click the beside the Control field, and then click to add a Keyboard event that launches the local action,
UniversityCompactList, in an overlay.
- To enable keyboard navigation within the overlay, set focus from the Text Input control to the first row within the overlay. To do this, you need to know the system-generated clipboard name of the Report Definition bound to the grid displayed in the overlay. You can find this name in the Pages and Classes tab of the section you created containing the repeat grid, in this case,
- Add the Page Name and Class in the Pages and Classes tab of the section containing the Text Input control configured with the overlay.
- Click the beside the Text Input Control field, and then click to add another Keyboard event.
- Specify the Target as the page name,
pgRepPgSubSectionUniversityCompactListB.pxResults, and the set the Focus On the First Row.
- Set the final event to refresh the current section on Change.
The Behaviors area should now appears as follows.
- Click OK on the Parameters dialog and then save your changes.
- Run the flow. Type a letter in the text input box to display the overlay. The list in the overlay is filtered as you type, displaying the university name and logo. Focus is set to the first row of the overlay and keyboard navigation is enabled.
- Double-click or press Enter to select a university from the list.