Package com.adito.properties.attributes.wizards.forms

Examples of com.adito.properties.attributes.wizards.forms.AttributeDefinitionOptionsForm


   * @throws Exception on any error
   */
  public ActionForward typeChanged(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
   
    // Set a default validator when type changes
    AttributeDefinitionOptionsForm adof = (AttributeDefinitionOptionsForm)form;
    if(adof.getType() == PropertyDefinition.TYPE_COLOR ||
            adof.getType() == PropertyDefinition.TYPE_LIST ||
            adof.getType() == PropertyDefinition.TYPE_MULTI_ENTRY_LIST ||
            adof.getType() == PropertyDefinition.TYPE_MULTI_SELECT_LIST ||
            adof.getType() == PropertyDefinition.TYPE_TIME_IN_MS) {
      getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_VALIDATION_STRING, "");
    }
    else if(adof.getType() == PropertyDefinition.TYPE_BOOLEAN ) {
      getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_VALIDATION_STRING, "com.adito.input.validators.BooleanValidator");     
    }
    else if(adof.getType() == PropertyDefinition.TYPE_INTEGER) {
      getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_VALIDATION_STRING, "com.adito.input.validators.IntegerValidator(minValue=0,maxValue=9999999)");
    }
    else if(adof.getType() == PropertyDefinition.TYPE_STRING) {
      getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_VALIDATION_STRING, "com.adito.input.validators.StringValidator(minLength=0,maxLength=30,trim=true,regExp=,pattern=)");
    }
    else if(adof.getType() == PropertyDefinition.TYPE_TEXT_AREA) {
      getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_VALIDATION_STRING, "com.adito.input.validators.StringValidator(minLength=0,maxLength=255,trim=true,regExp=,pattern=)");
    }
   
    getWizardSequence(request).putAttribute(AttributeDefinitionOptionsAction.ATTR_TYPE, new Integer(adof.getType()));
   
    return super.unspecified(mapping, form, request, response);
  }
View Full Code Here

TOP

Related Classes of com.adito.properties.attributes.wizards.forms.AttributeDefinitionOptionsForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.