Validate on multiple widget fields
Hi there.
I'm writing a edit page for a document that requires a combination of two fields to be unique. Is there a way of validating a component based on multiple widget fields in the layouts-contrib.xml file?
Hi,
You can take example on what's been done in the default user layout to perform password confirm validation. The generic explanation on how to perform cross validation is here: http://blogs.nuxeo.com/dev/2009/03/cross-validation-with-jsf.html
You can take example on the default nuxeo implementation (layout configuration, custom widget template, and java code of the validation method):
- https://github.com/nuxeo/nuxeo-jsf/blob/release-5.5/nuxeo-platform-webapp-base/src/main/resources/OSGI-INF/layouts-contrib.xml
- https://github.com/nuxeo/nuxeo-jsf/blob/release-5.5/nuxeo-platform-webapp-base/src/main/resources/web/nuxeo.war/widgets/user_password_validation_widget_template.xhtml
- https://github.com/nuxeo/nuxeo-jsf/blob/release-5.5/nuxeo-platform-webapp-base/src/main/java/org/nuxeo/ecm/webapp/security/UserManagementActions.java (method validatePassword)