On Change of first drop down value write a DT and in that DT loop the second page list and copy the Data conditionally in to some temporary page list. Like if the Country is Not equal to value stated in the first property then Append or Append & Map. Now once all the iteration is completed then re-copy this temporary page list data in to the source of second drop down.
Note: Maintain second drop down source data in one more PageList as a back up so that when user change the first value to some other country and re change again copy can be made first from backup page list and then above code will be executed.
Approach 2 : Configure on-change refresh this section on first property and for second drop down a parameterized D_Page or Report definition can be specified as source, the value that is selected in property 1 can be passed to the parameter of D_Page or RD and data can be retrieved dynamically. In the stated sources filter data based on country. This comes at the cost of Performance. Every time DB hit happens.
Onchange write DT and execute Utilities • removeDuplicatesFromList() function to remove duplicates based on only country name look up. Keep back up of original list and every time copy this first and then remove.
You could use Obj-Filter method to achieve this functionality easily.
In the second drop-down source Data Page post load processing activity use Obj-Filter method and in filter when condition you can have your logic to remove the first drop-down selected values...
You just need to pass the first drop down selected value as input parameter to second drop down data page and based on this parameter value you could build your Obj-Filter when condition..
Usage Of Obj-Filter = Use the Obj-Filter method to filter the embedded pages of a results page (such as a Code-Pega-List page produced by the RDB-List, Obj-List-View or Obj-Browse methods) based on one or more when condition rules.
Posted: 10 months ago
Posted: 15 Nov 2021 1:32 EST
Avik Mitra (AvikMitra)
If you are using D_page -> Report definition to load the data, simply keep a parameter in RD for filter. Instead of removing from pagelist, do not even retrieve it from DB. Removal of record will unnecessarily increase looping.