cancel
Showing results for 
Search instead for 
Did you mean: 

[5.8] Phonenumber in profile may contain non numeric characters

Bauke_Roo
Star Contributor
Star Contributor

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

1 REPLY 1

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

You need to use the extension point "widgets", not "widgettypes", but otherwise, it seems all good.

Getting started

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.