PAJES 3.0.21

org.pajes.html.validation
Class IsMandatory

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

public class IsMandatory
extends ValidationFunction

Creates a JavaScript validation function to validate that the user entered a value. The mandatory check can be set to depend upon the existence of values in other input elements.

See Also:
Serialized Form

Constructor Summary
IsMandatory()
          Creates a JavaScript validation function.
IsMandatory(InputField element, java.lang.String displayName)
          Creates a JavaScript validation function.
IsMandatory(InputField element, java.lang.String displayName, boolean dependantRequired, Input[] dependantFields)
          Creates a JavaScript validation function.
IsMandatory(InputField element, java.lang.String displayName, Input[] dependantFields)
          Creates a JavaScript validation function.
 
Method Summary
 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

IsMandatory

public IsMandatory()
Creates a JavaScript validation function.


IsMandatory

public IsMandatory(InputField element,
                   java.lang.String displayName)
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.

IsMandatory

public IsMandatory(InputField element,
                   java.lang.String displayName,
                   boolean dependantRequired,
                   Input[] dependantFields)
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.
dependantRequired - is true if this element is mandatory if ANY of the dependantFields specified has a value, or false if this element is mandatory if NONE of the dependantFields specified has a value.
dependantFields - is an array of Input instances whose values determine if this element is considered mandatory.

IsMandatory

public IsMandatory(InputField element,
                   java.lang.String displayName,
                   Input[] dependantFields)
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.
dependantFields - is an array of Input instances whose values must be provided before this element is considered mandatory. If ANY of the dependantFields specified has a value, the mandatory check will be carried out on this element.
Method Detail

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.