PAJES 3.0.21

org.pajes.html
Class InputField

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.Input
          extended by org.pajes.html.InputField
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML, InputMandatoryValidation, InputValidation
Direct Known Subclasses:
InputFile, InputPassword, InputString, InputTextArea

public abstract class InputField
extends Input
implements InputMandatoryValidation, InputValidation

This class is the base class for all the form input elements that have a text box for entry.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Input
TYPE_ATTRIBUTE
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
protected InputField(InputField source)
          Creates an input field from another input field.
protected InputField(java.lang.String type)
          Creates an input field.
protected InputField(java.lang.String type, Form form, java.lang.String name)
          Creates an input field.
 
Method Summary
 java.lang.String getClientValidation(Browser browser)
          Returns the client validation rules applicable to this input element as a string.
 java.lang.Integer getMaxLength()
          Retrieves the maximum number of characters that are allowed in the input box.
 java.lang.Integer getSize()
          Retrieves the width of the input box.
 boolean isMandatory()
          Determines if this field is mandatory or not.
 Input setMandatory(boolean valueIsRequired)
          Sets validation to ensure the user enters a value in this field.
 InputField setMandatory(boolean valueIsRequired, java.lang.String fieldName)
          Sets validation to ensure the user enters a value in this field.
 InputField setMandatory(boolean valueIsRequired, java.lang.String fieldName, Input[] dependantFields)
          Sets validation to ensure the user enters a value in this field.
 InputField setMaxLength(int characters)
          Sets the maximum number of characters that are allowed in the input box.
 InputField setMaxLength(java.lang.Integer characters)
          Sets the maximum number of characters that are allowed in the input box.
 InputField setSize(int size)
          Sets the width of the input box.
 InputField setSize(java.lang.Integer size)
          Sets the width of the input box.
 
Methods inherited from class org.pajes.html.Input
addClientValidation, addContent, clone, getClientValidation, getDOMReference, getFieldNameForErrorMessage, getForm, getInstance, getLabel, getName, getOnBlurHandler, getOnChangeHandler, getOnFocusHandler, getOnSelectHandler, getReadOnlyStyleSheetClass, getTabIndex, getType, getValue, isChangeFlagEnabled, isDisabled, isReadOnly, isRequiringValidation, logNoFormWarning, removeClientValidation, removeClientValidation, removeClientValidation, removeMandatoryClientValidation, setChanged, setChangedFlag, setContent, setDisabled, setFieldNameInErrorMessage, setFieldNameInErrorMessage, setForm, setId, setLabel, setName, setOnBlurHandler, setOnBlurValidation, setOnChangeHandler, setOnClickHandler, setOnFocusHandler, setOnSelectHandler, setReadOnly, setReadOnlyStyleSheetClass, setTabIndex, setTabIndex, setTabIndex, setValue, write
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getParent, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, hasAttribute, init, initAttributes, isChildOf, isChildOf, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setParent, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, writeContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pajes.html.InputValidation
getDOMReference, getName, isRequiringValidation, setOnBlurValidation
 

Constructor Detail

InputField

protected InputField(InputField source)
Creates an input field from another input field.

Parameters:
source - the input field from which this input field will be created.

InputField

protected InputField(java.lang.String type)
Creates an input field.

Parameters:
type - the type attribute of the <input> tag.

InputField

protected InputField(java.lang.String type,
                     Form form,
                     java.lang.String name)
Creates an input field.

Parameters:
type - the type attribute of the <input> tag.
form - the form on which this input field will appear. Note that the element must still be added to the form - this reference is used by the getDOMReference() method to determine the fully qualified element name.
name - the name to apply to the input object, so that it may be manipulated using client-side JavaScript.
Method Detail

getClientValidation

public java.lang.String getClientValidation(Browser browser)
Description copied from class: Input
Returns the client validation rules applicable to this input element as a string.

Specified by:
getClientValidation in interface InputValidation
Overrides:
getClientValidation in class Input
Parameters:
browser - the browser to which the output is being sent.
Returns:
the client validation rules as a string.
See Also:
Input.getClientValidation(org.pajes.servlet.Browser)

getMaxLength

public java.lang.Integer getMaxLength()
Retrieves the maximum number of characters that are allowed in the input box.

Returns:
the maximum number of characters, or null if the maximum number of characters has not been set.

getSize

public java.lang.Integer getSize()
Retrieves the width of the input box.

Returns:
the width of the the input box, or null if the input box width has not been set.

isMandatory

public boolean isMandatory()
Determines if this field is mandatory or not.

Specified by:
isMandatory in interface InputMandatoryValidation
Returns:
true if this field is mandatory, or false if it is not.

setMandatory

public Input setMandatory(boolean valueIsRequired)
Sets validation to ensure the user enters a value in this field.

Specified by:
setMandatory in interface InputMandatoryValidation
Parameters:
valueIsRequired - true if a value is mandatory.
Returns:
the modified Input object.

setMandatory

public InputField setMandatory(boolean valueIsRequired,
                               java.lang.String fieldName)
Sets validation to ensure the user enters a value in this field.

Parameters:
valueIsRequired - true if a value is mandatory.
fieldName - is the name of the field to display in the error message.
Returns:
the modified InputField object.

setMandatory

public InputField setMandatory(boolean valueIsRequired,
                               java.lang.String fieldName,
                               Input[] dependantFields)
Sets validation to ensure the user enters a value in this field.

Parameters:
valueIsRequired - true if a value is mandatory.
fieldName - is the name of the field to display in the error message.
dependantFields - is an array of element names whose values must be provided before this element is considered mandatory. If ANY of the dependantElements specified has a value, the mandatory check will be carried out on this element.
Returns:
the modified InputField object.

setMaxLength

public InputField setMaxLength(int characters)
Sets the maximum number of characters that are allowed in the input box.

Parameters:
characters - the maximum number of characters.
Returns:
the modified InputField object.

setMaxLength

public InputField setMaxLength(java.lang.Integer characters)
Sets the maximum number of characters that are allowed in the input box.

Parameters:
characters - the maximum number of characters.
Returns:
the modified InputField object.

setSize

public InputField setSize(int size)
Sets the width of the input box.

Parameters:
size - the width of the the input box.
Returns:
the modified InputField object.

setSize

public InputField setSize(java.lang.Integer size)
Sets the width of the input box.

Parameters:
size - the width of the the input box.
Returns:
the modified InputField object.

PAJES 3.0.21

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