Content Fragment: Custom Content Reference Field Validation (AEM 6.4)
Hello,
I have a content fragment model that leverages a content reference field as such...
<_x0031_597244630515
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/contentreference"
fieldLabel="Product Name"
listOrder="27"
metaType="reference"
name="richproductName"
nameSuffix="contentReference"
required="on"
renderReadOnly="false"
showEmptyInReadOnly="true"
valueType="string"/>
I see that with the addition of the rootPath attribute, I can limit the directory to where a reference can be made. However, this doesnt stop someone from linking to something in the directory that shouldn't be there (say if someone creates an invalid experience fragment.) Is there a way to add some kind of validation/code that I can run when someone selects something from the content reference field?

