com.gargoylesoftware.htmlunit.html
Class HtmlSubmitInput
java.lang.Object
com.gargoylesoftware.htmlunit.html.DomNode
com.gargoylesoftware.htmlunit.html.DomNamespaceNode
com.gargoylesoftware.htmlunit.html.DomElement
com.gargoylesoftware.htmlunit.html.HtmlElement
com.gargoylesoftware.htmlunit.html.StyledElement
com.gargoylesoftware.htmlunit.html.ClickableElement
com.gargoylesoftware.htmlunit.html.FocusableElement
com.gargoylesoftware.htmlunit.html.HtmlInput
com.gargoylesoftware.htmlunit.html.HtmlSubmitInput
- All Implemented Interfaces:
- DisabledElement, SubmittableElement, Serializable, Cloneable
public class HtmlSubmitInput
- extends HtmlInput
Wrapper for the HTML element "input".
- Version:
- $Revision: 2132 $
- Author:
- Mike Bowler, David K. Taylor, Christian Sell, Daniel Gredler, Ahmed Ashour
- See Also:
- Serialized Form
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE |
Method Summary |
String |
asText()
Returns a text representation of this element that represents what would
be visible to the user if this page was shown in a web browser. |
protected Page |
doClickAction(Page defaultPage)
This method will be called if there either wasn't an onclick handler or there was
but the result of that handler was true. |
KeyValuePair[] |
getSubmitKeyValuePairs()
Return an array of KeyValuePairs that are the values that will be sent
back to the server whenever the current form is submitted. |
protected void |
printOpeningTagContentAsXml(PrintWriter printWriter)
Prints the content between "<" and ">" (or "/>") in the output of the tag name
and its attributes in xml format. |
void |
reset()
Return the value of this element to the default value or checked state (usually what it was at
the time the page was loaded, unless it has been modified via JavaScript). |
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlInput |
click, getAcceptAttribute, getAccessKeyAttribute, getAlignAttribute, getAltAttribute, getCheckedAttribute, getDefaultValue, getDisabledAttribute, getMaxLengthAttribute, getNameAttribute, getOnBlurAttribute, getOnChangeAttribute, getOnFocusAttribute, getOnSelectAttribute, getReadOnlyAttribute, getSizeAttribute, getSrcAttribute, getTabIndexAttribute, getTypeAttribute, getUseMapAttribute, getValueAttribute, isChecked, isDefaultChecked, isDisabled, setChecked, setDefaultChecked, setDefaultValue, setDefaultValue, setValueAttribute |
Methods inherited from class com.gargoylesoftware.htmlunit.html.ClickableElement |
click, click, click, dblClick, dblClick, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute, isStateUpdateFirst |
Methods inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
addHtmlAttributeChangeListener, appendChildIfNoneExists, assertNotEmpty, blur, cloneDomNode, cloneNode, fireEvent, fireEvent, fireHtmlAttributeAdded, fireHtmlAttributeRemoved, fireHtmlAttributeReplaced, focus, getAttribute, getAttributeEntriesIterator, getAttributeNS, getAttributeValue, getChildElementsIterator, getEnclosingElement, getEnclosingForm, getEnclosingFormOrDie, getEventHandler, getHtmlElementById, getHtmlElementsByAttribute, getHtmlElementsByTagName, getHtmlElementsByTagNames, getId, getNodeName, getNodeType, getOneHtmlElementByAttribute, getTabIndex, getTagName, hasAttribute, hasAttributeNS, hasAttributes, hasHtmlElementWithId, isAttributeDefined, isEmptyXmlTagExpanded, isSubmittableByEnter, keyDown, keyDown, mouseDown, mouseDown, mouseMove, mouseMove, mouseOut, mouseOut, mouseOver, mouseOver, mouseUp, mouseUp, notImplemented, preventDefault, printXml, removeAttribute, removeAttributeNS, removeChild, removeEventHandler, removeHtmlAttributeChangeListener, rightClick, rightClick, setAttribute, setAttributeNS, setAttributeValue, setAttributeValue, setEventHandler, setEventHandler, setId, toString, type, type, type, type |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asXml, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLog, getNativePage, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, insertBefore, isAncestorOf, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removePropertyChangeListener, replace, setNextSibling, setNodeValue, setParentNode, setPreviousSibling, setReadyState, setScriptObject |
HtmlSubmitInput
public HtmlSubmitInput(HtmlPage page,
Map attributes)
- Deprecated. You should not directly construct HtmlSubmitInput.
- Create an instance
- Parameters:
page
- The page that contains this elementattributes
- the initial attributes
doClickAction
protected Page doClickAction(Page defaultPage)
throws IOException
- This method will be called if there either wasn't an onclick handler or there was
but the result of that handler was true. This is the default behavior of clicking
the element. The default implementation returns the current page - subclasses
requiring different behavior (like
HtmlSubmitInput
) will override this
method.
- Overrides:
doClickAction
in class ClickableElement
- Parameters:
defaultPage
- The default page to return if the action does not
load a new page.
- Returns:
- The page that is currently loaded after execution of this method
- Throws:
IOException
- If an IO error occurred
reset
public void reset()
- Return the value of this element to the default value or checked state (usually what it was at
the time the page was loaded, unless it has been modified via JavaScript). This method does nothing for submit input elements.
- Specified by:
reset
in interface SubmittableElement
- Overrides:
reset
in class HtmlInput
- See Also:
SubmittableElement.reset()
asText
public String asText()
- Returns a text representation of this element that represents what would
be visible to the user if this page was shown in a web browser. For
example, a single-selection select element would return the currently selected
value as text. Returns "Submit Query" if value attribute is not defined.
- Overrides:
asText
in class HtmlInput
- Returns:
- The element as text.
printOpeningTagContentAsXml
protected void printOpeningTagContentAsXml(PrintWriter printWriter)
- Prints the content between "<" and ">" (or "/>") in the output of the tag name
and its attributes in xml format. Doesn't print the attribute if it is value="Submit Query".
- Overrides:
printOpeningTagContentAsXml
in class HtmlElement
- Parameters:
printWriter
- the writer to print in
getSubmitKeyValuePairs
public KeyValuePair[] getSubmitKeyValuePairs()
- Return an array of KeyValuePairs that are the values that will be sent
back to the server whenever the current form is submitted.
THIS METHOD IS INTENDED FOR THE USE OF THE FRAMEWORK ONLY AND SHOULD NOT
BE USED BY CONSUMERS OF HTMLUNIT. USE AT YOUR OWN RISK.
Returns "Submit Query" if name attribute is defined and value attribute is not defined.
- Specified by:
getSubmitKeyValuePairs
in interface SubmittableElement
- Overrides:
getSubmitKeyValuePairs
in class HtmlInput
- Returns:
- See above
Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.