* @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);
}