MultiSelection DropDown on Assets Metadata Schema | Community
Skip to main content
francisco_ribei
New Participant
December 16, 2015
Solved

MultiSelection DropDown on Assets Metadata Schema

  • December 16, 2015
  • 3 replies
  • 1746 views

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

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 smacdonald2008

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

3 replies

francisco_ribei
New Participant
December 17, 2015

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.

smacdonald2008
smacdonald2008Accepted solution
New Participant
December 16, 2015

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

francisco_ribei
New Participant
December 16, 2015

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.