A Data Page can be used to provide the source for the options of a dropdown UI control in Pega 7. The dropdown control can be configured to either show a simple list of items or to aggregate the items with a Group By configuration.
- The below screen shot shows a Pega drop down UI control, where the options (…here US cities) are grouped by a property (…here US state). This post shows how such a drop down can be quickly created in Pega 7.1.9.
- Description of Data Type and Data Page for Storing Cities
- Source Options by Data Page and Group Pega 7 Dropdown by Property
- Sort Dropdown Options with Data Transform in Pega 7.1.9
- Configure a Pega 7 Auto-Complete Control Backed by Data Table
- Example of Cascading Drop Downs in Pega 7
1 Description of Data Type and Data Page for Storing Cities
- In this example, a Data Type named
PGX-MyStore-Data-Citywas created using the Data Explorer.
- The Records tab of that Data Type shows 14 records that were created:
- The Properties of the City Data Type are shown in the Data Explorer in the above screen shot.
- When the Data Type was created, 2 Data Pages were generated as well.
D_CityListis a Page List and contains the 14 instances of
2 Source Options by Data Page and Group Pega 7 Dropdown by Property
- A section contains a dropdown that allows to select a city based on the
- The dropdown’s properties are shown below. The Data Page
D_CityListis used for the List Source.
Nameproperty is used for displaying the options in the dropdown in ascending order.
- The check box Group Items is checked and the property to group by is set to
- Running the section shows the dropdown with the city options grouped by US state.
- Note that the city names within each group are sorted in ascending order.
- The order can be changed using the Report Definition
DataTableEditorReportthat was automatically created when the
CityData Type was setup. See Example of How to Create Report Definitions in Pega 7 for details on Pega Report Definitions.
- The Query tab of the Report Definition is shown below.
- Here, the City property
Populationis used to sort the records in descending order using
Highest to lowestfor the sort type value.
- When running the section again, the city names within each
Stategroup are now sorted im descending order by
Population, i.e. New York City comes first within the New York state group (…see screen shot of City records at the beginning of this section for population values).