|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.HtmlForm
public class HtmlForm
Wrapper for the html element "form"
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
HtmlElement.ChildElementsIterator, HtmlElement.MapEntryWrappingIterator |
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
DomNode.ChildIterator, DomNode.DescendantElementsIterator |
Field Summary | |
---|---|
static String |
TAG_NAME
the HTML tag represented by this element |
Fields inherited from class com.gargoylesoftware.htmlunit.html.HtmlElement |
---|
ATTRIBUTE_NOT_DEFINED, ATTRIBUTE_VALUE_EMPTY, TAB_INDEX_OUT_OF_BOUNDS |
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 |
Constructor Summary | |
---|---|
HtmlForm(HtmlPage htmlPage,
Map attributes)
Deprecated. You should not directly construct HtmlForm. |
Method Summary | |
---|---|
void |
fakeCheckedRadioButton(String name,
String value)
Deprecated. after 1.11 |
String |
getAcceptAttribute()
Return the value of the attribute "accept". |
String |
getAcceptCharsetAttribute()
Return the value of the attribute "accept-charset". |
String |
getActionAttribute()
Return the value of the attribute "action". |
HtmlButton |
getButtonByName(String name)
Find the first button element with the specified name. |
List |
getButtonsByName(String name)
Return all the HtmlButtons that match the specified name |
HtmlRadioButtonInput |
getCheckedRadioButton(String name)
Return the first checked radio button with the specified name. |
String |
getEnctypeAttribute()
Return the value of the attribute "enctype". |
HtmlInput |
getInputByName(String name)
Return the first input with the specified name |
HtmlInput |
getInputByValue(String value)
Return the first input with the specified value. |
List |
getInputsByName(String name)
Return the input tags that have the specified name |
List |
getInputsByValue(String value)
Return all the inputs with the specified value. |
String |
getMethodAttribute()
Return the value of the attribute "method". |
String |
getNameAttribute()
Return the value of the attribute "name". |
String |
getOnResetAttribute()
Return the value of the attribute "onreset". |
String |
getOnSubmitAttribute()
Return the value of the attribute "onsubmit". |
List |
getParameterListForSubmit(SubmittableElement submitElement)
Return a list of KeyValuePair s that represent the data that will be
sent to the server on a form submit. |
HtmlRadioButtonInput |
getRadioButtonInput(String name,
String value)
Deprecated. Deprecated because 'name' and 'value' are sometimes not unique to select a single HtmlRadioButtonInput, it should not be called, you can use DomNode.getByXPath(String) instead. |
List |
getRadioButtonsByName(String name)
Return a list of HtmlInputs that are of type radio and match the specified name |
HtmlSelect |
getSelectByName(String name)
Find the first select element with the specified name |
List |
getSelectsByName(String name)
Return all the HtmlSelect that match the specified name |
Collection |
getSubmittableElements(SubmittableElement submitElement)
Return a collection of elements that represent all the "submittable" elements in this form |
String |
getTargetAttribute()
Return the value of the attribute "target". |
HtmlTextArea |
getTextAreaByName(String name)
Find the first textarea element with the specified name. |
List |
getTextAreasByName(String name)
Return all the HtmlTextAreas that match the specified name |
Page |
reset()
Reset this form to its initial values. |
void |
setActionAttribute(String action)
Set the value of the attribute "action". |
void |
setCheckedRadioButton(String name,
String value)
Deprecated. Deprecated because 'name' and 'value' are sometimes not unique to select a single HtmlRadioButtonInput, it should not be called, you can use DomNode.getByXPath(String) instead. |
void |
setEnctypeAttribute(String encoding)
Set the value of the attribute "enctype". |
void |
setMethodAttribute(String method)
Set the value of the attribute "method". |
void |
setNameAttribute(String name)
Set the value of the attribute "name". |
void |
setTargetAttribute(String target)
Set the value of the attribute "target". |
Page |
submit()
Deprecated. after 1.11, click on a specific SubmittableElement instead. |
Page |
submit(String buttonName)
Deprecated. after 1.11, click on the specific SubmittableElement instead. |
Page |
submit(SubmittableElement submitElement)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. Submit this form to the appropriate server. |
Methods inherited from class com.gargoylesoftware.htmlunit.html.ClickableElement |
---|
click, click, click, dblClick, dblClick, doClickAction, getLangAttribute, getOnClickAttribute, getOnDblClickAttribute, getOnKeyDownAttribute, getOnKeyPressAttribute, getOnKeyUpAttribute, getOnMouseDownAttribute, getOnMouseMoveAttribute, getOnMouseOutAttribute, getOnMouseOverAttribute, getOnMouseUpAttribute, getTextDirectionAttribute, getXmlLangAttribute, isStateUpdateFirst |
Methods inherited from class com.gargoylesoftware.htmlunit.html.StyledElement |
---|
getClassAttribute, getIdAttribute, getStyleAttribute, getTitleAttribute, isRenderedVisible |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode |
---|
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String TAG_NAME
Constructor Detail |
---|
public HtmlForm(HtmlPage htmlPage, Map attributes)
htmlPage
- The page that contains this elementattributes
- the initial attributesMethod Detail |
---|
public Page submit(String buttonName) throws IOException, ElementNotFoundException
SubmittableElement
instead.
buttonName
- The name of a submit input element or a button element
which will be sent back up with the response
IOException
- If an IO error occurs
ElementNotFoundException
- If a button with the specified name cannot be found.public Page submit() throws IOException
SubmittableElement
instead.
IOException
- If an IO error occurspublic Page submit(SubmittableElement submitElement) throws IOException
submitElement
- The element that caused the submit to occur
IOException
- If an IO error occurspublic final List getParameterListForSubmit(SubmittableElement submitElement)
KeyValuePair
s that represent the data that will be
sent to the server on a form submit. This is primarily intended to aid
debugging.
submitElement
- The element that would have been pressed to submit the
form or null if the form was submitted by javascript.
KeyValuePair
s.public Page reset()
public Collection getSubmittableElements(SubmittableElement submitElement)
submitElement
- The element that would have been pressed to submit the
form or null if the form was submitted by javascript.
public List getInputsByName(String name)
name
- The name of the input
public final HtmlInput getInputByName(String name) throws ElementNotFoundException
name
- The name of the input
ElementNotFoundException
- If no inputs could be found with the specified name.public HtmlRadioButtonInput getRadioButtonInput(String name, String value) throws ElementNotFoundException
DomNode.getByXPath(String)
instead.
name
- The name of the HtmlInputvalue
- The value of the HtmlInput
ElementNotFoundException
- If the field could not be foundpublic List getSelectsByName(String name)
name
- The name
public HtmlSelect getSelectByName(String name) throws ElementNotFoundException
name
- The name of the select element
ElementNotFoundException
- If the select cannot be found.public List getButtonsByName(String name) throws ElementNotFoundException
name
- The name
ElementNotFoundException
- If no matching buttons were foundpublic HtmlButton getButtonByName(String name) throws ElementNotFoundException
name
- The name of the button element.
ElementNotFoundException
- If the button cannot be found.public List getTextAreasByName(String name)
name
- The name
public HtmlTextArea getTextAreaByName(String name) throws ElementNotFoundException
name
- The name of the textarea element.
ElementNotFoundException
- If the textarea cannot be found.public List getRadioButtonsByName(String name)
name
- The name
public void setCheckedRadioButton(String name, String value) throws ElementNotFoundException
DomNode.getByXPath(String)
instead.
fakeCheckedRadioButton(String,String)
instead
name
- The name of the radio buttonsvalue
- The value to match
ElementNotFoundException
- If the specified element could not be foundpublic final void fakeCheckedRadioButton(String name, String value) throws ElementNotFoundException
name
- The name of the radio buttonsvalue
- The value to match
ElementNotFoundException
- If a particular xml element could not be found in the dom modelpublic HtmlRadioButtonInput getCheckedRadioButton(String name)
name
- The name of the radio button
public final String getActionAttribute()
public final void setActionAttribute(String action)
action
- The value of the attribute "action"public final String getMethodAttribute()
public final void setMethodAttribute(String method)
method
- The value of the attribute "method" or an empty string if that attribute isn't defined.public final String getNameAttribute()
public final void setNameAttribute(String name)
name
- the new valuepublic final String getEnctypeAttribute()
Enctype is the encoding type used when submitting a form back to the server
public final void setEnctypeAttribute(String encoding)
Enctype is the encoding type used when submitting a form back to the server
encoding
- The value of the attribute "enctype" or an empty string if that attribute isn't defined.public final String getOnSubmitAttribute()
public final String getOnResetAttribute()
public final String getAcceptAttribute()
public final String getAcceptCharsetAttribute()
public final String getTargetAttribute()
public final void setTargetAttribute(String target)
target
- The value of the attribute "target" or an empty string if that attribute isn't defined.public HtmlInput getInputByValue(String value) throws ElementNotFoundException
value
- The value
ElementNotFoundException
- If no elements can be found with the specified value.public List getInputsByValue(String value)
value
- The value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |