Validate text field on document creation
I have a custom document and I want to validate one of the fields, which is a text field, before document creation. Validation means parsing it against a regular expression. Is there any way to do this in Nuxeo?
Each field is implemented as a JSF component. You can use validation system.
Easy way with Nuxeo Studio/IDE, here is the documentation:
But if you want to do it yourself, because you feel as an JSF expert :
I got this error message: validator="#{MyValidator.validate}": Target Unreachable, identifier 'MyValidator' resolved to null
In nuxeo studio, for the widget I want I have the validator set to #{MyValidator.validate} I have added this to the deployment-fragment: <extension target="faces-config#VALIDATOR">
<validator>
<validator-id>MyValidator</validator-id>
<validator-class>com.dm.validators.MyValidator</validator-class>
</validator>
</extension>
The com.dm.validators.MyValidator class exists, is public and implements implements javax.faces.validator.Validator.
Can you help me with this?