Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

MultiSelection DropDown on Assets Metadata Schema

Avatar

Level 6

Hi,

We need to have a dropdown with multi selection on metada schema.

The dropdown one we have on the schema editor it only allows the one for single selection.

I know the widget for coral ui we can set that. I tried editing the node on crxde lite and set the property multiple to false, and it rendered allowing multiple selection.

I'd like to know if this is a good practice or not.

Is there any recommendation on this?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

"widget for coral ui we can set that. I tried editing the node on crxde lite and set the property multiple to false, and it rendered allowing multiple selection."

Using out of the box components/widgets and modifying them is best practice. One of the best ways to learn AEM is to use ootb components as a starting point. 

View solution in original post

3 Replies

Avatar

Level 6

One thing I noticed, it is when we update the field on the metadata editor, it removes the property we added on the CRXDE lite.

So, as far as I can see, we can add on the CRXDE Lite, but if the schema is edited the property added will be removed.

Avatar

Correct answer by
Level 10

"widget for coral ui we can set that. I tried editing the node on crxde lite and set the property multiple to false, and it rendered allowing multiple selection."

Using out of the box components/widgets and modifying them is best practice. One of the best ways to learn AEM is to use ootb components as a starting point. 

Avatar

Level 6

I was able to allow multiselection on dropdown for metadata schema.

In order to do that I need to do the following:

  • Overlay the /libs/dam/gui/content/metadataschemaeditor/schemadetails/jcr:content/body/content/items/step/items/content/items/formbuilder
    • I needed to do that because it has a property formfields where it specifies the path of the form field components used in the formbuilder and it was fixed to use: /libs/dam/gui/components/admin/schemaforms/formbuilder/formfields. So, if I needed to change anything I would need to change on libs folder. I changed only this property to remove the /libs/ prefix. The value I set was: dam/gui/components/admin/schemaforms/formbuilder/formfields, this way I can overlay the component on apps folder and get the changes loaded;
  • Overlay the  /libs/dam/gui/components/admin/schemaforms/formbuilder/formfields/dropdownfield
    • I made that to change the dropdownfield.jsp to add a new input field for the multiple property in the JSP, I added the code below:
<% ValueMap props = resource.adaptTo(ValueMap.class); String multiple = props.get("multiple", String.class); %> <input type="hidden" name="./items/<%= key %>/multiple" value="<%=multiple != null ? multiple : ""%>">

So, with this change I can add the multiple propety in the node using CRXDE Lite and the change will be persisted even if I change the metadata schema form.

Thanks.