Repeating Elements for List Views
This presentation is part of the Advanced UI Techniques Self-Study Course.
Transcript
List view rules are a very powerful tool for formatting repeating elements of data. Traditionally, they are used to define the criteria to retrieve, sort, and display data, such as worklists, that display on our default portal.
List views provide the ability to sort repeating elements without the need to build complex custom JavaScript. This functionality can also be used to format repeating rows of data.
Within the CPM framework, list views are often used to format repeating elements of data returned from external service calls. For example, when searching for a contact, an activity is processed that looks for customers on an external database and retrieves the results set prior to the screen being rendered.
You can define an activity within the Report Source section of the form. Essentially, your activity could ensure the content you wish to display is present on the clipboard. If not, it creates a blank page with zero results enabling the list view to display without error.
This list view is then embedded within a normal section using a Pega ListView JSP tag that allows you to stay guardrail compliant.
Note: When defining list views to purely format data, you must always define one element in the Get These Fields section of the form. This need not relate to anything you wish to display. Leaving this element blank will not allow the rule to save, and adding in a property that is not exposed will cause guardrail compliance alerts to be generated. A simple way around this is to define pyLabel as the field in the Get These Fields section within each of your custom list view rules.
Within the list view definition, you can then define what rows are selectable.
- Single – each result is displayed with a radio button.
- Multiple – each result is displayed with a checkbox.
Depending on the "Copy To" method chosen, the selected rows are mapped to the clipboard in a number of different ways. This is particularly useful in Search and Select functionality.