Posted: 2 Mar 2016 14:51 EST Last activity: 5 Apr 2016 15:26 EDT
how to filter a dropdown by the selection in another dropdown
@In 6.x, you could filter one Dynamic Select by the selection made in another by passing a parameter, as in the screenshot below. The reference was done by HTML Element ID, which easily dodged the potential complexity of referencing from one page that could be embedded several levels deep below pyWorkPage to another - especially when the two properties are embedded in Lists/Groups.
In Pega 7, Dynamic Selects were deprecated in favor of Dropdown controls, which do not seem to have this exact feature. There are other ways to do this, but none of them matches the missing feature. The following table compares the methods of doing this sort of filtering and makes plain what appears (to my eyes) to be missing:
How it works
Accomplishes the same thing?
Original method: take a parameter from a Dynamic Select identified by a HTML Element ID
Using the Element ID bypasses the challenge of referencing one property from another. That referencing gets quite difficult if the two properties are in different data classes and nested a couple levels deep in collections (Lists or Groups)
Clipboard Page or Data Page
This is a nice new feature in Pega 7. Ensure that the first Dropdown sets a property that can be referenced from the second Dropdown.
No. The hard part is the referencing. Suppose the page contexts of the two Dropdowns are like this:
To specify a reference from one to another of those pages would be rather complex because
- the embedded pages can't assume that the structure of their siblings will be the same in every instance that a section is used
- the embedded pages don't know the List/grousubscript of the sibling they need to reference
For List Source, use a ReportDefinition filtered by Param.SomeCriterion
OnChange of the first Dropdown, use an Activity or DataTransform to set a property on the Param page
The question here is "which parameter page"? Is the parameter page available to the Report Definition/Dropdown the same as the Param page for the Activity/DataTransform that sets the filtering property?
Apologies for the slow response. I was drawn away to resolve some more severe problems and now I am just checking in briefly before heading out to vacation for a week. I very much appreciate your sending those articles. I will read them when I get back and then update this post.
however, it assumes the use of Data Pages. My application makes use of several Dynamic Selects driven by ListViews. It appeared to me that swapping Data Pages for ListViews would require more work, and more learning, than swapping Report Definitions for ListViews.
It suggests using a Dropdown control with a report definition that takes a parameter. I had initially experimented with that but had some trouble passing the right clipboard property. See my initial post, where I wrote "The hard part is the referencing..." and discussed referencing into page lists.
The answer was returning to that approach and sorting out the property referencing so that it didn't require an awkward jump from one level into an embedded page on another level.