PAJES 3.0.21

org.pajes.html.validation
Class IsLength

java.lang.Object
  extended by org.pajes.html.validation.ValidationFunction
      extended by org.pajes.html.validation.IsLength
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class IsLength
extends ValidationFunction

Creates a JavaScript validation function to validate that the value entered by the user has the number of characters within the specifed range.

See Also:
Serialized Form

Constructor Summary
IsLength()
          Creates a JavaScript validation function.
IsLength(InputField element, java.lang.String displayName, int minLength, int maxLength, boolean mandatory)
          Creates a JavaScript validation function.
 
Method Summary
 void setMaxLength(int maxLength)
          Sets the maxLength.
 void setMaxLength(java.lang.String maxLength)
          Sets the maxLength.
 void setMinLength(int minLength)
          Sets the minLength.
 void setMinLength(java.lang.String minLength)
          Sets the minLength.
 java.lang.String toJavaScript(Browser browser)
          Converts the validation function into a string to be returned to the browser.
 
Methods inherited from class org.pajes.html.validation.ValidationFunction
clone, getDisplayName, getInputField, isMandatory, setDisplayName, setInputField, setMandatory, setMandatory, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsLength

public IsLength()
Creates a JavaScript validation function.


IsLength

public IsLength(InputField element,
                java.lang.String displayName,
                int minLength,
                int maxLength,
                boolean mandatory)
Creates a JavaScript validation function.

Parameters:
element - the input field to be validated.
displayName - the name of the field that will appear in any error messages.
minLength - the minimum allowable number of characters for this input element.
maxLength - the maximum allowable number of characters for this input element.
mandatory - true if a value is required, or false if it may be left blank.
Method Detail

setMaxLength

public void setMaxLength(int maxLength)
Sets the maxLength.

Parameters:
maxLength - the maxLength.

setMaxLength

public void setMaxLength(java.lang.String maxLength)
Sets the maxLength.

Parameters:
maxLength - the maxLength.

setMinLength

public void setMinLength(int minLength)
Sets the minLength.

Parameters:
minLength - the minLength.

setMinLength

public void setMinLength(java.lang.String minLength)
Sets the minLength.

Parameters:
minLength - the minLength.

toJavaScript

public java.lang.String toJavaScript(Browser browser)
Converts the validation function into a string to be returned to the browser.

Specified by:
toJavaScript in class ValidationFunction
Parameters:
browser - the browser to which the function will be returned.
Returns:
the string consisting of the JavaScript function that will be sent to the browser to validate the input field.

PAJES 3.0.21

Copyright 1998-2007 Viridian Pty Limited. All Rights Reserved.