PAJES 2.3.9

org.pajes.html
Class Form

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.TraversableElement
          extended byorg.pajes.html.Container
              extended byorg.pajes.html.Form
All Implemented Interfaces:
java.lang.Cloneable, HTML, java.io.Serializable, Traversable
Direct Known Subclasses:
FileUploadForm

public class Form
extends Container

Container class for form elements

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
Form()
          Creates an empty form with a defualt name.
Form(java.lang.String formName)
          Creates a form with the specified name.
Form(java.lang.String formName, java.lang.String actionURL)
          Creates a form with the specified name and a specified action URL.
Form(java.lang.String formName, java.lang.String actionURL, java.lang.String targetFrame)
          Creates a form with the specified name and an action URL to be directed to a specified frame.
 
Method Summary
 Container add(HTML htmlObject)
          Over-rides Container.add(HTML) to ensure that the validation function is not added to the form.
 java.lang.Object clone()
          Allows a form to be cloned.
 java.lang.String getActionURL()
          Returns the action URL for this form.
 java.lang.String getName()
          Returns the name of this form.
 java.lang.String getOnChangeFlagName()
          Returns the name of the JavaScript variable that flags that changes have been made to the form.
 java.lang.String getValidationFunctionName()
          Returns the name of the JavaScript validation function that will validate the fields on this form.
protected  org.pajes.html.Tag.Attributes initAttributes()
          Called whenever a new, empty set of tag attributes is required.
 Form setActionURL(java.lang.String actionURL)
          Sets the URL to invoked to process the contents of the form.
protected  void setAttribute(TagAttribute attribute)
          Adds the specified attribute.
 Form setFormName(java.lang.String formName)
          Sets the name of the form.
 Form setMimeType(java.lang.String mimeType)
          Sets the MIME encoding type of the form.
 Form setOnResetHandler(java.lang.String onResetHandler)
          Sets the JavaScript handler for this event.
 Form setOnSubmitHandler(java.lang.String onSubmitHandler)
          Sets the JavaScript handler for this event.
 Form setTargetFrame(java.lang.String targetFrame)
          Sets the target frame for the results of the form processing.
 Form setUseGetMethod()
          Specifies that the form should be submitted using the HTTP GET method.
 Form setUsePostMethod()
          Specifies that the form should be submitted using the HTTP POST method.
protected  void writeContent(Browser browser)
          Loops through the container and gets each object contained within it and invokes that objects write method.
 
Methods inherited from class org.pajes.html.Container
add, add, add, addContent, clear, delete, delete, destroy, get, getContent, getContents, getPosition, insert, replace, set, setContent, setContent, size
 
Methods inherited from class org.pajes.html.TraversableElement
dump, dump, getAll, getFieldByName, getFirstFieldByName, getFirstTagByAttribute, getFirstTagByClass, getFirstTagByID, getFirstTagByName, getTagByAttribute, getTagByClass, getTagByID, getTagByName, setWritable
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, getAttribute, getAttributes, getAttributeSet, getContainer, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, init, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setId, setOnClickHandler, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Form

public Form()
Creates an empty form with a defualt name.


Form

public Form(java.lang.String formName)
Creates a form with the specified name.

Parameters:
formName - the name of the form.

Form

public Form(java.lang.String formName,
            java.lang.String actionURL)
Creates a form with the specified name and a specified action URL.

Parameters:
formName - the name of the form.
actionURL - the URL to process the form contents.

Form

public Form(java.lang.String formName,
            java.lang.String actionURL,
            java.lang.String targetFrame)
Creates a form with the specified name and an action URL to be directed to a specified frame.

Parameters:
formName - the name of the form.
actionURL - the URL to process the form contents.
targetFrame - the name of the frame to receive the result document.
Method Detail

setActionURL

public Form setActionURL(java.lang.String actionURL)
Sets the URL to invoked to process the contents of the form.

Parameters:
actionURL - the URL to process the form contents.
Returns:
the modified Form object.

getActionURL

public java.lang.String getActionURL()
Returns the action URL for this form.

Returns:
the action URL.

setFormName

public Form setFormName(java.lang.String formName)
Sets the name of the form.

Parameters:
formName - the name of the form.
Returns:
the modified Form object.

setMimeType

public Form setMimeType(java.lang.String mimeType)
Sets the MIME encoding type of the form.

Parameters:
mimeType - the MIME type to be used to set the encoding of the form when it is submitted.
Returns:
the modified Form object.

getName

public java.lang.String getName()
Returns the name of this form.

Returns:
the name of this form.

getOnChangeFlagName

public java.lang.String getOnChangeFlagName()
Returns the name of the JavaScript variable that flags that changes have been made to the form.

Returns:
the JavaScript variable name.

setOnResetHandler

public Form setOnResetHandler(java.lang.String onResetHandler)
Sets the JavaScript handler for this event.

Parameters:
onResetHandler - the JavaScript handler for this event.
Returns:
the modified Form object.

setOnSubmitHandler

public Form setOnSubmitHandler(java.lang.String onSubmitHandler)
Sets the JavaScript handler for this event.

Parameters:
onSubmitHandler - the JavaScript handler for this event.
Returns:
the modified Form object.

setTargetFrame

public Form setTargetFrame(java.lang.String targetFrame)
Sets the target frame for the results of the form processing.

Parameters:
targetFrame - the name of the frame to receive the result document.
Returns:
the modified Form object.

setUseGetMethod

public Form setUseGetMethod()
Specifies that the form should be submitted using the HTTP GET method.

Returns:
the modified Form object.
See Also:
setUsePostMethod()

setUsePostMethod

public Form setUsePostMethod()
Specifies that the form should be submitted using the HTTP POST method.

Returns:
the modified Form object.
See Also:
setUseGetMethod()

getValidationFunctionName

public java.lang.String getValidationFunctionName()
Returns the name of the JavaScript validation function that will validate the fields on this form.

Returns:
the JavaScript validation function name.

add

public Container add(HTML htmlObject)
Over-rides Container.add(HTML) to ensure that the validation function is not added to the form.

Overrides:
add in class Container
Parameters:
htmlObject - the HTML to be added to the form.
Returns:
the updated form

clone

public java.lang.Object clone()
Allows a form to be cloned. Over-rides the clone() method in Container to ensure that all form references are updated correctly.

Specified by:
clone in interface HTML
Overrides:
clone in class Container
Returns:
a clone of the Form instance.

setAttribute

protected void setAttribute(TagAttribute attribute)
Adds the specified attribute.

Overrides:
setAttribute in class Tag
Parameters:
attribute - The attribute.

initAttributes

protected org.pajes.html.Tag.Attributes initAttributes()
Called whenever a new, empty set of tag attributes is required.

Overrides:
initAttributes in class Tag
Returns:
a new Attributes instance.

writeContent

protected void writeContent(Browser browser)
                     throws java.io.IOException
Loops through the container and gets each object contained within it and invokes that objects write method.

Overrides:
writeContent in class Container
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 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.