Skip to main content
Level 4
Mar 16, 2022 10:00 AM UTC
Solved

multi select dropdown explaination

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.
milind_bachani
milind_bachaniAccepted solution
Adobe Employee
Mar 16, 2022 12:21 PM UTC

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.

3 replies

milind_bachani
Adobe Employee
milind_bachaniAdobe EmployeeAccepted solution
Adobe Employee
Mar 16, 2022 12:21 PM UTC

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.

Translate
Siva_Sogalapalli
Community Advisor
Community Advisor
Mar 16, 2022 12:31 PM UTC

@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.

Translate
Jul 8, 2024 5:57 PM UTC

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?
Translate