FileDocCategorySizeDatePackage
SmartDynaValidatorForm.javaAPI DocExample2294Thu Dec 15 22:25:36 GMT 2005com.oreilly.jent.struts.library.ui

SmartDynaValidatorForm

public class SmartDynaValidatorForm extends org.apache.struts.validator.DynaValidatorForm
author
jgn
version
$Id$

Fields Summary
private boolean
calledOnce
Constructors Summary
public SmartDynaValidatorForm()

  
    
    super();
  
Methods Summary
public voidreset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)

    
    if ( ! calledOnce) {
      calledOnce = true;
      return;
    }
    
    // Turn off all checkboxes (Booleans) when non-existent in form
    DynaProperty[] dps = getDynaClass().getDynaProperties();
    for (int i = 0; i < dps.length; i++) {
      DynaProperty dp = dps[i];
      String name = dp.getName();
      if (get(name) instanceof Boolean) {
        Boolean value = (Boolean) get(name);
        if (request.getParameter(name) == null) {
          set(name, Boolean.FALSE);
        }
      }
    }