11-11-2014 05:35 AM
Hi There,
I noticed that it is possible to fill in non numeric characters in the phone number field of a user.
I might want to change this behavior. Is it correct that I have to extend the weblayoutManager widgettypes Extensionpoint (Like this file: http://fisheye.nuxeo.com/browse/nuxeo-user-center/nuxeo-user-profile/src/main/resources/OSGI-INF/lay... )
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager" point="widgettypes">
Then add a widtget with a property validator
<widget name="phonenumber" type="text">
<labels>
<label mode="any">label.userprofile.phonenumber</label>
</labels>
<translated>true</translated>
<fields>
<field>userprofile:phonenumber</field>
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
<property name="validator">#{myValidatorBean.validatePhoneNumber}</property>
</properties>
</widget>
And finally create a validator as specified on this page: http://doc.nuxeo.com/display/NXDOC/Add+Field+Validation
I think This is the way to go, but I just wanted to check 🙂
Best regards,
Bauke Roo
11-14-2014 12:48 PM
Hi,
You need to use the extension point "widgets", not "widgettypes", but otherwise, it seems all good.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.