Saturday, September 01, 2012

Input validation & formatting at client side in Pega

Client side validation is a very useful and beautiful feature of any web applications. The basic validations and formatting which doesn't require server side action can be done at the client side i.e. browser side mostly, and then the user submission can be passed on to the server.

Two useful things of client side validation are,
  • Reducing the serverside action, thus, reducing the burden/load on the server for the simple validations.
  • Increasing the response time of the application. I.e. user need not have to wait for the request to be sent to the user and wait for the server to respond back to just say, "One text field is empty in the user form".
Pega provides rules Rule-Edit-Input and Rule-Edit-Validate for such formatting/conversions and validations.

Rule-Edit-Input : This is provided in the advance tab of the property rule form. This performs conversions and not validations. No response will be sent to the user reg. the input validity. This rule performs conversions(as required by our application) and the sets the value back to the same property.

Rule-Edit-Validate : This is provided in the advance tab of the property rule form. This performs validation and adds(i.e. associates) message to the property if the validation fails. Any property/page with associated message in the clipboard is not considered valid in pega.


Both Rule-Edit-Input and Rule-Edit-Validate rules are java based i.e. these rules are written in java. Pega by default provides some rules of each type for basic functions. Its open to the user to add your own rules of each type for further control and customization of the application.

Examples are as:



Please feel free to contact me if i'm missing anything.


No comments: