I do indeed have the config element in the XML.
Thanks for the alternate solution suggestion. Do you happen to have a link to your code please?
Okay, thanks for checking.
Alternative solution is to create an xml file under src/main/resources/alfresco/web-extension/site-data/extensions. Name it whatever you want, like validator.xml.
In that file you would put something like:
<modules>
<module>
<id>Someco Share Form Configuration</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<configurations><config>
<forms>
<dependencies>
<js src="/resources/someco-share/js/validator.js"/>
</dependencies>
</forms>
</config><config evaluator="node-type" condition="sc:doc">
<forms>
<form>
<field-visibility>
<show id="cm:name" />
<show id="cm:title" force="true" />
<show id="sc:someProp" /></field-visibility>
<appearance>
<field id="cm:name">
<control>
<control-param name="maxLength">255</control-param>
</control>
</field>
<field id="cm:title">
<control template="/org/alfresco/components/form/controls/textfield.ftl" />
</field>
<field id="sc:someProp" label-id="form.field.label.sc.someProp" description-id="form.field.description.sc.someProp" help-id="form.field.help.sc.someProp">
<constraint-handlers>
<constraint type="scDateValidator" message-id="constraint.scDateValidation" validation-handler="SomeCo.forms.validation.scSomePropValidatior" event="onChange"/>
</constraint-handlers>
</field>
</appearance>
</form></config>
</configurations>
</module>
</modules>
</extension>
That is just awesome Jeff, you are a superstar! Using this approach, with minor modifications, the Javascript validator function is now visible in the browser, and is actually being called by my form. You're very welcome to post this answer up on SO, and I'll give you the rep points.
Thanks also to Sanjay Bandhniya for contributing.
Many thanks, I've been banging my head against this brick wall for days. I'd still love to know why the original config approach wasn't working.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.