Wednesday, July 18, 2012

Problem of PPR+Validation+Auto Submit

Use Case : If the AutoSubmit property of any input field is enabled  and validation is done on other input field in a form, many a times on partial submit of the first input field, validation error occurs in the second input field.
So to turn off the server-side validation, we have to extend 'oracle.adf.controller.v2.lifecycle.PageController' in the backing bean and override the 'validateModelUpdates()' as shown below:


  1. public class MyBackingBean extends oracle.adf.controller.v2.lifecycle.PageController {
  2. public void validateModelUpdates(LifecycleContext context) {
  3. FacesContext fctx = FacesContext.getCurrentInstance();
  4. //skip validation on partial submit
  5. if(PartialPageUtils.isPartialRequest(fctx)){
  6. //super.validateModelUpdates(context); //skip - no refresh
  7. }else
  8. {
  9. super.validateModelUpdates(context);
  10. }
  11. }

No comments:

Post a Comment