May 10, 2020
Estimated Post Reading Time ~

Use JS to Read the Generic List

use(function () {
var resolver = request.getResourceResolver();
var pageManager = resolver.adaptTo(Packages.com.day.cq.wcm.api.PageManager);
return {
genericList:getList(<listName>)

};

function getList(url){
var listPage = pageManager.getPage(url);
if(listPage==null){
return;
}
var list = listPage.adaptTo(Packages.com.adobe.acs.commons.genericlists.GenericList);
var genericList= list.getItems();
return genericList;
}
});


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.