https://docs.oracle.com/middleware/1212/adf/ADFDC/general.htm#ADFDC101
Tuesday, May 26, 2015
Sunday, May 24, 2015
Create Custom and Reusable Validator in ADF
You can either create a validation method on the page's backing bean (if you want custom validation for a component on a single page), or create JSF validator classes (if you want to reuse the validation logic by various pages in the application).
In case of custom validator class, your custom class should implement Validator class and override a method validate(FacesContext fc, UIComponent, uiC, Object, obj) with custom logic. This method should throw Validator Exception in case of validation failure.
if(validationFails){
throw new ValidatorException(new FacesMessage(FacesMessage.SERIVITY_ERROR, 'Email is not in valid format.', null));
}
You must register custom validator class in faces-config.xml file under Validators section( ID, Class) to use it in page UI components.
To apply validation on UI component, right click on
Page->UIComponent(inputText) and select 'insert inside'->JSF core->validator->Validator ID
Source: http://jjzheng.blogspot.in/2010/10/create-custom-validators-in-adf.html
In case of custom validator class, your custom class should implement Validator class and override a method validate(FacesContext fc, UIComponent, uiC, Object, obj) with custom logic. This method should throw Validator Exception in case of validation failure.
if(validationFails){
throw new ValidatorException(new FacesMessage(FacesMessage.SERIVITY_ERROR, 'Email is not in valid format.', null));
}
You must register custom validator class in faces-config.xml file under Validators section( ID, Class) to use it in page UI components.
To apply validation on UI component, right click on
Page->UIComponent(inputText) and select 'insert inside'->JSF core->validator->Validator ID
Source: http://jjzheng.blogspot.in/2010/10/create-custom-validators-in-adf.html
Subscribe to:
Posts (Atom)