PAJES 3.0.21

org.pajes.html
Class Submit

java.lang.Object
  extended by org.pajes.html.Tag
      extended by org.pajes.html.Input
          extended by org.pajes.html.Submit
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HTML
Direct Known Subclasses:
SubmitAnchor, SubmitButton, SubmitImage

public abstract class Submit
extends Input

This abstract class is extended by classes that provide the ability to select an HTML element on a form that will submit the contents of the form for processing.

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 Submit(java.lang.String type)
          Default constructor intialises some internal fields.
 
Method Summary
protected  InputHidden getHiddenField()
          Returns the hidden field that will be updated with the specified value when the submit is requested.
protected  java.lang.String getHiddenFieldValue()
          Returns value that will be placed in the specified hidden field when the submit is requested.
protected  HTML getInactiveText()
          Sets the HTML object that will be displayed if the submit function is inactive.
 boolean isActive()
          Returns whether the default active object will be displayed, or whether the inactive object will to be shown.
protected  boolean isOnChangeCheckingDisabled()
          Returns whether if the check for changed fields is to executed.
protected  boolean isOnClickValidationDisabled()
          Returns whether on click validation is to be executed.
 Submit setActive(boolean status)
          Sets whether the default active object is to be displayed, or whether the inactive object is to be shown.
protected  void setChanged(Browser browser)
          Over-rides Input.setChanged(Browser) so that submitting a form will not set the changed flag.
 Submit setCheckForChangedFields(boolean enable)
          Enables or disables check for changed fields before submitting when on click validation has been disabled on the constructor.
 Submit setCheckForChangedFieldsConfirmation(java.lang.String text)
          Sets the text that will be displayed in a JavaScript confirm() function if any fields have been changed.
 Submit setHiddenField(InputHidden hiddenField, java.lang.String fieldValue)
          The specified hidden field will be updated with the specified value when the button is pushed.
 Submit setInactiveText(HTML object)
          Sets the HTML object that will be displayed if the anchor is inactive.
 Submit setInactiveText(java.lang.String text)
          Sets the text that will be displayed if the anchor is inactive.
 Submit setOnClickValidation(boolean enable)
          Enables or disables validation of fields before submitting.
 Submit setSubmitConfirmation(java.lang.String text)
          Sets the text that will be displayed in a JavaScript confirm() function prior to actually submitting the form, so that the user has a chance to confirm the action.
 void write(Browser browser)
          Writes the submit tag to the browser.
protected  void writeSubmitJavaScript(Browser browser, java.lang.StringBuilder onClickHandler)
          Called by the write(org.pajes.servlet.Browser) method to append the appropriate JavaScript to the OnClick handler written to the browser to handle the form submission.
protected  void writeTag(Browser browser)
          Called by the write(org.pajes.servlet.Browser) method to write the actual 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, setChangedFlag, setContent, setDisabled, setFieldNameInErrorMessage, setFieldNameInErrorMessage, setForm, setId, setLabel, setName, setOnBlurHandler, setOnBlurValidation, setOnChangeHandler, setOnClickHandler, setOnFocusHandler, setOnSelectHandler, setReadOnly, setReadOnlyStyleSheetClass, setTabIndex, setTabIndex, setTabIndex, setValue
 
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
 

Constructor Detail

Submit

protected Submit(java.lang.String type)
Default constructor intialises some internal fields.

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

isActive

public boolean isActive()
Returns whether the default active object will be displayed, or whether the inactive object will to be shown.

Returns:
true if the default active object will be displayed, or false if the inactive object will to be shown.

setActive

public Submit setActive(boolean status)
Sets whether the default active object is to be displayed, or whether the inactive object is to be shown.

Parameters:
status - true if the default active object is to be displayed and the anchor should respond to the click, or false if the inactive object is to be displayed and should not respond to a click.
Returns:
the modified Submit object.

setCheckForChangedFields

public Submit setCheckForChangedFields(boolean enable)
Enables or disables check for changed fields before submitting when on click validation has been disabled on the constructor.

Parameters:
enable - true if the check for changed fields is to executed (the default), or false to disable.
Returns:
the modified Submit object.
See Also:
setCheckForChangedFieldsConfirmation(java.lang.String)

setCheckForChangedFieldsConfirmation

public Submit setCheckForChangedFieldsConfirmation(java.lang.String text)
Sets the text that will be displayed in a JavaScript confirm() function if any fields have been changed. If not specified, the default is "Discard changes?".

Parameters:
text - the text to be displayed in the confirmation message. If null or an empty string is specified, the default value will be used.
Returns:
the modified Submit object.
See Also:
setCheckForChangedFields(boolean)

setHiddenField

public Submit setHiddenField(InputHidden hiddenField,
                             java.lang.String fieldValue)
The specified hidden field will be updated with the specified value when the button is pushed.

Parameters:
hiddenField - the hidden field input element whish will be updated when the button is pressed.
fieldValue - the value to set in the hidden field.
Returns:
the modified Submit object.

setInactiveText

public Submit setInactiveText(HTML object)
Sets the HTML object that will be displayed if the anchor is inactive.

Parameters:
object - is the object to be displayed when the anchor is inactive.
Returns:
the modified Submit object.

setInactiveText

public Submit setInactiveText(java.lang.String text)
Sets the text that will be displayed if the anchor is inactive.

Parameters:
text - is the text to be displayed when the anchor is inactive.
Returns:
the modified Submit object.

setOnClickValidation

public Submit setOnClickValidation(boolean enable)
Enables or disables validation of fields before submitting.

Parameters:
enable - if false, disables the onClick validation.
Returns:
the modified Submit object.

setSubmitConfirmation

public Submit setSubmitConfirmation(java.lang.String text)
Sets the text that will be displayed in a JavaScript confirm() function prior to actually submitting the form, so that the user has a chance to confirm the action. If the text is null or an empty string (the default), no confirmation will be displayed.

Note that this is NOT the text to be displayed if onClick validation has been disabled.

Parameters:
text - is the text to be displayed.
Returns:
the modified Submit object.

write

public void write(Browser browser)
           throws java.io.IOException
Writes the submit 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)

getHiddenField

protected InputHidden getHiddenField()
Returns the hidden field that will be updated with the specified value when the submit is requested.

Returns:
the hidden field input element whish will be updated when the submit is requested.

getHiddenFieldValue

protected java.lang.String getHiddenFieldValue()
Returns value that will be placed in the specified hidden field when the submit is requested.

Returns:
the modified Submit object.

getInactiveText

protected HTML getInactiveText()
Sets the HTML object that will be displayed if the submit function is inactive.

Returns:
the modified Submit object.

isOnChangeCheckingDisabled

protected boolean isOnChangeCheckingDisabled()
Returns whether if the check for changed fields is to executed.

Returns:
true if the check for changed fields is disabled.

isOnClickValidationDisabled

protected boolean isOnClickValidationDisabled()
Returns whether on click validation is to be executed.

Returns:
true if on click validation is disabled.

setChanged

protected void setChanged(Browser browser)
Over-rides Input.setChanged(Browser) so that submitting a form will not set the changed flag.

Overrides:
setChanged in class Input
Parameters:
browser - the browser to which the tag is being written.
See Also:
Input.setChanged(Browser)

writeSubmitJavaScript

protected void writeSubmitJavaScript(Browser browser,
                                     java.lang.StringBuilder onClickHandler)
Called by the write(org.pajes.servlet.Browser) method to append the appropriate JavaScript to the OnClick handler written to the browser to handle the form submission.

Parameters:
browser - the browser to which the results are to be output.
onClickHandler - the onClickHandler to which the JavaScript code should be appended.

writeTag

protected void writeTag(Browser browser)
                 throws java.io.IOException
Called by the write(org.pajes.servlet.Browser) method to write the actual tag to the browser.

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.

PAJES 3.0.21

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