PAJES 3.0.21

org.pajes.html.validation
Class IsBetween

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

public class IsBetween
extends ValidationFunction

Creates a JavaScript validation function to validate that the value entered by the user is within the specifed range. The range may be specified as an integer, a double or a string. The minimum and maximum values are optional: ie if only the minimum value is supplied, the user-entered value must be greater than it, or if only the maximum value is supplied, the user-entered value must be less than it.

See Also:
Serialized Form

Constructor Summary
IsBetween()
          Creates a JavaScript validation function.
IsBetween(InputField element, java.lang.String displayName, boolean mandatory, java.lang.Double minValue, java.lang.Double maxValue)
          Creates a JavaScript validation function.
IsBetween(InputField element, java.lang.String displayName, boolean mandatory, java.lang.Integer minValue, java.lang.Integer maxValue)
          Creates a JavaScript validation function.
IsBetween(InputField element, java.lang.String displayName, boolean mandatory, java.lang.String minValue, java.lang.String maxValue)
          Creates a JavaScript validation function.
 
Method Summary
 void setMaxValue(java.lang.Double maxValue)
          Sets the maxValue.
 void setMaxValue(java.lang.Integer maxValue)
          Sets the maxValue.
 void setMaxValue(java.lang.String maxValue)
          Sets the maxValue.
 void setMinValue(java.lang.Double minValue)
          Sets the minValue.
 void setMinValue(java.lang.Integer minValue)
          Sets the minValue.
 void setMinValue(java.lang.String minValue)
          Sets the minValue.
 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

IsBetween

public IsBetween()
Creates a JavaScript validation function.


IsBetween

public IsBetween(InputField element,
                 java.lang.String displayName,
                 boolean mandatory,
                 java.lang.Double minValue,
                 java.lang.Double maxValue)
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.
mandatory - true if a value is required, or false if it may be left blank.
minValue - the minimum allowable value for this input element.
maxValue - the maximum allowable value for this input element.

IsBetween

public IsBetween(InputField element,
                 java.lang.String displayName,
                 boolean mandatory,
                 java.lang.Integer minValue,
                 java.lang.Integer maxValue)
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.
mandatory - true if a value is required, or false if it may be left blank.
minValue - the minimum allowable value for this input element.
maxValue - the maximum allowable value for this input element.

IsBetween

public IsBetween(InputField element,
                 java.lang.String displayName,
                 boolean mandatory,
                 java.lang.String minValue,
                 java.lang.String maxValue)
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.
mandatory - true if a value is required, or false if it may be left blank.
minValue - the minimum allowable value for this input element.
maxValue - the maximum allowable value for this input element.
Method Detail

setMaxValue

public void setMaxValue(java.lang.Double maxValue)
Sets the maxValue.

Parameters:
maxValue - the maxValue.

setMaxValue

public void setMaxValue(java.lang.Integer maxValue)
Sets the maxValue.

Parameters:
maxValue - the maxValue.

setMaxValue

public void setMaxValue(java.lang.String maxValue)
Sets the maxValue.

Parameters:
maxValue - the maxValue.

setMinValue

public void setMinValue(java.lang.Double minValue)
Sets the minValue.

Parameters:
minValue - the minValue.

setMinValue

public void setMinValue(java.lang.Integer minValue)
Sets the minValue.

Parameters:
minValue - the minValue.

setMinValue

public void setMinValue(java.lang.String minValue)
Sets the minValue.

Parameters:
minValue - the minValue.

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.