Tuesday 18 February 2020

Country Selector

Prerequisites:
Install ACS Commons packages in aem server from package manager [/crx/packmgr/index.jsp]
ACS package can be downloaded from https://github.com/Adobe-Consulting-Services/acs-aem-commons/releases
1) acs-aem-commons-content-4.4.0.zip
2) acs-aem-commons-ui.apps-4.4.0.zip

Steps:
1) Install Attached Package in AEM Instance
Click to Download File

* If you check filters of this package it contains 3 Generic lists and one sample page and one component.

2) Create below servlet in you project and deploy Bundle
Click to Download File

* This file contains Get Servelt

3) You can Test Country selector component present in Page:
/content/we-retail/us/en/test-page.html

Note:
1) Country List uses ACS Generic List to populate country names.
2) State List is generated using JS, which do ajax call to one java servlet.
This java servlet get call check for country parameter and based on that returns list of states from State Generic list of that country.
................................................................................................................................................
Info on how to use Generic List
From AEM Dashboard, navigate to
Tools -> ACS AEM Commons -> Generic Lists
   You will be redirected to http://localhost:4502/miscadmin#/etc/acs-commons/lists
Here you can create new page using Generic List template for creating new list under Generic Lists folder

Then double click and open any page, there we can option to add 'Generic List Item' component to add elements in parsys, its like key value pair. Edit it and author it.




No comments:

Post a Comment