com.sas.servlet.tbeans.util.validators
Interface JavaScriptValidationInterface

All Superinterfaces:
ValidationInterface
All Known Implementing Classes:
DateStringValidator, HexColorStringValidator, IntegerInputValidator, JavaScriptValidator, MaximumLengthValidator, MaximumValueValidator, MinimumValueValidator, NumericInputValidator, RequiredStringValidator

public interface JavaScriptValidationInterface
extends ValidationInterface

ValidationInterface is used to allow an object to validate input, normalize input and return error information when the information is invalid.

The ValidationInterface was designed to be used by input components such as the TextField. Components which used validators should implement the ValidatorInterface so that there is a standard way to set/get the validator.

com.sas.util.validators.Validator is a default implementation of the ValidationInterface.


Method Summary
 java.lang.String createValidationFunctionCall(TransformationInterface bean)
          Returns a String containing the entire Javascript validation function call.
 java.lang.String getClearErrorsFunctionName()
          Gets the name of the clear errors function.
 java.lang.String getErrorHandlerFunctionName()
          Gets the name of the error handler function.
 java.lang.String getValidationFunctionName()
          Gets the name of the validation function.
 void setClearErrorsFunctionName(java.lang.String name)
          Sets the name of the clear errors javascript function to call to clear all validations that have failed.
 void setErrorHandlerFunctionName(java.lang.String name)
          Sets the name of the error handler function to call if validation fails.
 void setValidationFunctionName(java.lang.String name)
          Sets the name of the validation function to create if there are input fields associated with the form (via the validate methods).
 
Methods inherited from interface com.sas.util.validators.ValidationInterface
getValidationMessage, getValidationMessageCode, normalizeValue, setValidationMessage, validateValue
 

Method Detail

setValidationFunctionName

void setValidationFunctionName(java.lang.String name)
Sets the name of the validation function to create if there are input fields associated with the form (via the validate methods). The default is OnSubmit.

Parameters:
name - The validation function name

getValidationFunctionName

java.lang.String getValidationFunctionName()
Gets the name of the validation function.

Returns:
The validation function name

setErrorHandlerFunctionName

void setErrorHandlerFunctionName(java.lang.String name)
Sets the name of the error handler function to call if validation fails.

Parameters:
name - The error handler function name

getErrorHandlerFunctionName

java.lang.String getErrorHandlerFunctionName()
Gets the name of the error handler function.

Returns:
The error handler function name

setClearErrorsFunctionName

void setClearErrorsFunctionName(java.lang.String name)
Sets the name of the clear errors javascript function to call to clear all validations that have failed.

Parameters:
name - The clear errors function name

getClearErrorsFunctionName

java.lang.String getClearErrorsFunctionName()
Gets the name of the clear errors function.

Returns:
The clear errors function name

createValidationFunctionCall

java.lang.String createValidationFunctionCall(TransformationInterface bean)
Returns a String containing the entire Javascript validation function call.

Parameters:
bean - The transformation bean validation has been set on.
Returns:
functionCall The JavaScript validation function call.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.