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.

how to get all values from multiselect dropdown in aem?

Avatar

Level 5

hi , I am trying to access the selected values in AEM but only able to access the first value of the multiselect field

for e.g:

   var allRegionFields = document.querySelectorAll("coral-select.regionselect");// all multiselect fields i.e-3
         for(var i =0;i<allRegionFields.length;i++){
           console.log("validator call: ",allRegionFields[i].value); //it's returning only the 1st value selected in the multiselect
         }
 
 
how can I get all values for the multiselect dropdown
6 Replies

Avatar

Community Advisor

Hi @rahul234dabas 

 

It is suggested to access the dialog values in the java model and then pass them to HTL like this: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/htl-render-multiple-select...

 

Hope this helps!

 

Thanks,

Kiran Vedantam

Avatar

Community Advisor

Hi Rahul,

 

Where do you want to get the values, is it in the dialog or in the HTL?



Arun Patidar

Avatar

Level 5

not in HTL but in the listener file I need to have the values that is the js file in extraClientLibs

Avatar

Community Advisor

Please check https://developer.adobe.com/experience-manager/reference-materials/6-4/coral-ui/coralui3/Coral.Selec...

 

 

var instance = document.querySelector('.dropdown-class')
var allItems = instance.selectedItems()

 

 



Arun Patidar