PAJES 3.0.21

org.pajes.html
Class InputChecked

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.Input
          extended by org.pajes.html.InputChecked
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML, InputValidation
Direct Known Subclasses:
InputCheckBox, InputRadio

public abstract class InputChecked
extends Input
implements InputValidation

Super-class of Input elements that have only an on/off state.

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 InputChecked(InputField source, java.lang.String type)
          Creates a check input element from another input field.
protected InputChecked(java.lang.String type, Form form, java.lang.String name, java.lang.String value, boolean isChecked)
          Creates an input field that has an on/off state.
 
Method Summary
 boolean isChecked()
          Determines if the checkbox has been checked or not.
 boolean isMandatory()
          Determines if mandatory validation has been applied to this element.
 Input setChecked(boolean isChecked)
          Sets the initial value of the check box.
 Input setCheckedValue(java.lang.String value)
          Sets the the value returned if the check box is selected.
 InputChecked setDisplayText(HTML displayText)
          Sets the display text associated with the checked item.
 InputChecked setDisplayText(java.lang.String displayText)
          Sets the display text associated with the check box.
 InputChecked setDisplayTextOnLeft(boolean onLeft)
          Sets the location of the display text.
 Input setMandatory(boolean valueIsRequired)
          Sets validation to ensure the user selects an element with the same name as this.
 Input setMandatory(boolean valueIsRequired, java.lang.String fieldName)
          Sets validation to ensure the user selects an element with the same name as this.
 Input setValue(java.lang.String value)
          Checks the provided value against that initially defined for this element, and calls setChecked() with true if the values match, or false if they do not.
 void write(Browser browser)
          Writes the <input> tag to the browser.
 
Methods inherited from class org.pajes.html.Input
addClientValidation, addContent, clone, getClientValidation, 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
 
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
getClientValidation, getDOMReference, getName, isRequiringValidation, setOnBlurValidation
 

Constructor Detail

InputChecked

protected InputChecked(InputField source,
                       java.lang.String type)
Creates a check input element from another input field.

Parameters:
source - the input field from which this input field will be created.
type - the type attribute of the <input> tag.

InputChecked

protected InputChecked(java.lang.String type,
                       Form form,
                       java.lang.String name,
                       java.lang.String value,
                       boolean isChecked)
Creates an input field that has an on/off state.

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.
value - the value returned if the checkbox is selected
isChecked - Set to true if you want the check box to have a check in it.
Method Detail

isChecked

public boolean isChecked()
Determines if the checkbox has been checked or not.

Returns:
true if the checkbox has been checked.

isMandatory

public boolean isMandatory()
Determines if mandatory validation has been applied to this element. Note that if mandatory validation has been applied to anotherInputChecked object with the same name, this method will return false but will still be included in the validation.

Returns:
true if mandatory validation has been applied to this element.

setChecked

public Input setChecked(boolean isChecked)
Sets the initial value of the check box.

Parameters:
isChecked - true if the box is to be checked on initial display.
Returns:
the modified InputChecked object.

setCheckedValue

public Input setCheckedValue(java.lang.String value)
Sets the the value returned if the check box is selected.

Parameters:
value - the value returned if the check box is selected.
Returns:
the modified Input object.

setDisplayText

public InputChecked setDisplayText(HTML displayText)
Sets the display text associated with the checked item.

Parameters:
displayText - the text to be displayed.
Returns:
the modified InputChecked object.

setDisplayText

public InputChecked setDisplayText(java.lang.String displayText)
Sets the display text associated with the check box.

Parameters:
displayText - the text to be displayed.
Returns:
the modified InputChecked object.

setDisplayTextOnLeft

public InputChecked setDisplayTextOnLeft(boolean onLeft)
Sets the location of the display text.

Parameters:
onLeft - true if the text is to be displayed on the left of the check box, or false if it is to be displayed on the right
Returns:
the modified InputChecked object.

setMandatory

public Input setMandatory(boolean valueIsRequired)
Sets validation to ensure the user selects an element with the same name as this. For performance reasons, only one element in the group with the same name should have mandatory validation applied.

Parameters:
valueIsRequired - true if a value is mandatory.
Returns:
the modified Input object.

setMandatory

public Input setMandatory(boolean valueIsRequired,
                          java.lang.String fieldName)
Sets validation to ensure the user selects an element with the same name as this. For performance reasons, only one element in the group with the same name should have mandatory validation applied.

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

setValue

public Input setValue(java.lang.String value)
Checks the provided value against that initially defined for this element, and calls setChecked() with true if the values match, or false if they do not.

Overrides:
setValue in class Input
Parameters:
value - the value to assign.
Returns:
the modified Input object.

write

public void write(Browser browser)
           throws java.io.IOException
Writes the <input> tag to the browser.

Specified by:
write in interface HTML
Overrides:
write in class Input
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.
See Also:
Tag.setWriteEndTag(boolean), Tag.writeContent(org.pajes.servlet.Browser)

PAJES 3.0.21

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