1
votes

I am new to AEM. I have used ACS commons generic list for populating the drop down values. I have added the titles for french and english under localisation part of generic list for each item.consider my js(js based approach in sightly) would return itemList (for ex: var itemList = list.getItems();).
how can I get the locale based title available in generic list(for ex, how can i get the french title which i have included under localisation part), in place of ${list.title} mentioned in the below HTML code:

     <select data-sly-use.frm="sample_form.js"   data-sly-list.list="${frm}">
                            <option value="${list.value}">${list.title}

OR what is the other possibility to get the locale based title available in generic list with the help of sightly.

Could anyone help me on this. Thanks in advance :-)

1
how are you populating this list in your backend logic? Is is authorable or some other mechanism is there? - Abie
sample_form.js (I am getting the ACS-commons generic list here) "use strict"; use(function () { var resolver = sling.getRequest().getResource().getResourceResolver(); var pageManager = resolver.adaptTo(Packages.com.day.cq.wcm.api.PageManager); var listPage = pageManager.getPage("/etc/acs-commons/lists/sampleoption"); var list = listPage.adaptTo(Packages.com.adobe.acs.commons.genericlists.GenericList); var sampList= list.getItems(); return sampList; }); How can I get the French title (which I have given under the localisation part available in the Commons Generic list items) - Nizam

1 Answers

0
votes

Using JS API you can create custom Arrays that then can be used by the data-sly-list in order to traverse through all the information. I have done this successfully and I like the flexibility and separation of responsibilities.