Validate field using Regular Expression

Validate field using Regular Expression

ADF support Regular Expression to validate user input. It’s very helpful to validate field like phone number, email id and reduce lots of java code. ADF framework provides some predefined expression, but you can write any custom expression according your need. In this post I will add validation rule on Email attribute of Employees table.

  1. Select Email Attribute in Employees entity and go to validation tab.
  2. Then click on “Green Plus” icon to add new validation rule on attribute.
  3. On Dialog window select
  • Type=Regular Expression
  • Operator=Matches
  • Predefined Expression=Email Address

 

As you can see in following image regular expression automatically come for Email or you can defined your own expression.

 

  1. Then go to Failure handling tab and set message for error.

 

Output:-

About Manish Pandey

Manish is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply