Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Populate items in the dialog for filtering a list from content node

Avatar

Level 5

Hi Team,

 

I have data kept in a content node (content/test) and this node has multiple nodes with the name of Item_ID with similar values in jcr:content node (Title, Subtitle, link etc).

 

I can show all items on the UI by accessing the data using an OSGI service. Now, I want to add a feature for the AEM authors to filter the list from the component's dialog and show the items based on their needs and not the full list of items.

 

So, I want to populate all item's IDs as a dropdown in the dialog for the author to select whatever they want to show on the component's UI markup.

 

Is there a recommended way to implement this? OR any existing code sample, which can be referred to for this requirement?

 

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can check this blog on how to populate the dialog dropdown with ID using a resource type servlet.The servlet will basically read the nodes under /content/test and gives the json.

The dialog can use the json as datasource through servlet to populate it.

 

https://aemlab.blogspot.com/2019/07/aem-touch-ui-dropdown-from-json.html

 

Similar one : http://www.sgaemsolutions.com/2019/01/dynamically-populate-drop-down-values.html

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

You can check this blog on how to populate the dialog dropdown with ID using a resource type servlet.The servlet will basically read the nodes under /content/test and gives the json.

The dialog can use the json as datasource through servlet to populate it.

 

https://aemlab.blogspot.com/2019/07/aem-touch-ui-dropdown-from-json.html

 

Similar one : http://www.sgaemsolutions.com/2019/01/dynamically-populate-drop-down-values.html

 

Avatar

Level 5

Thanks Saravanan, I found the same references and used to resolve my problem statement.