Wednesday 8 May 2019

Cascading Auto Complete in Pega

Cascading Auto Complete in Pega

Functionality to implement: Have to display list of Country, then based on country selected have to show list of state, based on state selected have to display list of city.

Created a Local Data Table(TGB-HRAPPS-Data-LocationInformation) with sample data.


Created a section in Work class with 3 auto complete (Country, State, City)


For Country Property provided source as Report Definition and mapped Report Definition(GetCountry)


Provided Data source Property as .Country(TGB-HRApps-Data-LocationInformation) .List of country which is retrieved through report definition will display dynamically.


Below image displays GetCountry Report Definition. Checked Remove duplicate Check box so it will remove duplicate country.

Similarly state property also selected source as report definition. For GetState we have to pass selected country as parameter so that we can filter state which is in selected country.


For Data Source Property we have to give state which is retrieved in report definition.


Below image shows GetState report definition , Here we are getting List of state in the selected Country.


For city provided source as report definition(GetCity)


Provided City as Data source property.


Below image shows report definition to get city.


For all three property we have to give on change event as post value. So that selected value will update in Clipboard.


Result:

On clicking Down Arrow auto complete displays list of country.


Display list of state in country America.


In City auto complete it display list of city which is in state American State one.


2 comments:

  1. Excellent Post Mate :). CHeers

    ReplyDelete
  2. When the country is written exactly as it is registered, then with the mouse the cursor is placed in the next city field, the city data is not loaded, because the events were not executed.

    ReplyDelete