multi select dropdown explaination | Community
Skip to main content
New Participant
March 16, 2022
Solved

multi select dropdown explaination

  • March 16, 2022
  • 2 replies
  • 3198 views

Hi,

can anyone explain to me how to deal with multi select dropdown i.e. in which we can select multiple values in one dropdown 

can anyone tell me the properties that need to be different than normal dropdown and how to store the output from the multi dropdown?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by milind_bachani

Hi @rahul234dabas,

 

You can consider it be a string array, comma separated. You can refer the tag selection as well, when we use multiple tags to a resource, it is stored as String[] and this use case is analogous to it.

2 replies

Siva_Sogalapalli
New Participant
March 16, 2022

@rahul234dabas As replied in the below thread, the same works for this case as well but only additional property you need to add is mutliple =true and the values will be stored in comma separated string. 

 

<datatype
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldLabel="Select country"
multiple="true"
name="./country">
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/not-able-to-capture-words-after-space-in-coral-select-dropdown/td-p/444654 

 Hope this helps.

New Participant
July 8, 2024

Hi @siva_sogalapalli , I tried adding this property and got success but I am trying to get the string array values but getting failed. Please find the below snippet I used:

@ValueMapValue
private String[] fileType; 
private String fileTypeValues;
@PostConstruct
protected void fileExtanctions() { 
if (fileType != null && fileType.length > 0) {  
fileTypeValues = Arrays.stream(fileType).collect(Collectors.joining(", "));  
} else {  
fileTypeValues = "";  
}  
}
public String getFileTypeValues() {
return fileTypeValues;
}
But I am unable to get the string array initially. Can you please help me with this?
milind_bachani
milind_bachaniAccepted solution
Employee
March 16, 2022

Hi @rahul234dabas,

 

You can consider it be a string array, comma separated. You can refer the tag selection as well, when we use multiple tags to a resource, it is stored as String[] and this use case is analogous to it.