There are two ways you can add validation logic to ONEWEB Smart Forms.
JavaScript Validation
ONEWEB Smart Forms have Entity Actions to attach a JavaScript file to an entity. Please refer to Entity Actions section for more details on how to attach JavaScript to an entity.
JavaScript validation is used mainly for client-side validations such as check field formats or mandatory fields. First add a JavaScript file to the module action.
Now open the workspace in Eclipse and create the JavaScript file specified in the module action. Add the method to validate.
Build and publish to server. Once deployed to server don't forget to add this validation check to the field on AppDesigner. Click on the pencil edit icon for the field to open the configuration panel. Add the validation call in the source Tag property.
Java Validation
ONEWEB Smart Forms have Entity Actions to attach a custom Java class to an entity. Please refer to Entity Actions section for more details on how to attach Java class to an entity. Java validations are used for server-side validations before saving an Entity. First step is to add an Entity Action and specify the Java class name in the Class Action property.
Once a java class is attached to an entity through Entity Action, open the ONEWEB workspace in eclipse; create the java class as extend from "ProcessHelper" and implements "ProcessAction" interface. Eclipse will create a stub of the class. Now override method "validateResult()" to add custom validation logic before saving entity. Please refer to the validation section in Sample Apps for more detailed examples.
Once completed build and publish to server. Now ONEWEB will execute this validation check every time before saving the entity.