com.meterware.httpunit
Class SubmitButton

java.lang.Object
  extended bycom.meterware.httpunit.HTMLElementBase
      extended bycom.meterware.httpunit.FormControl
          extended bycom.meterware.httpunit.Button
              extended bycom.meterware.httpunit.SubmitButton
All Implemented Interfaces:
HTMLElement, ScriptingEventHandler

public class SubmitButton
extends Button

This class represents a submit button in an HTML form.


Field Summary
 
Fields inherited from class com.meterware.httpunit.Button
WITH_ID, WITH_LABEL
 
Fields inherited from class com.meterware.httpunit.FormControl
BUTTON_TYPE, CHECKBOX_TYPE, FILE_TYPE, HIDDEN_TYPE, IMAGE_BUTTON_TYPE, MULTIPLE_TYPE, PASSWORD_TYPE, RADIO_BUTTON_TYPE, RESET_BUTTON_TYPE, SINGLE_TYPE, SUBMIT_BUTTON_TYPE, TEXT_TYPE, TEXTAREA_TYPE, UNDEFINED_TYPE
 
Method Summary
protected  void addValues(com.meterware.httpunit.protocol.ParameterProcessor processor, java.lang.String characterSet)
          addValues if not disabled and pressed
 void click(int x, int y)
          Performs the action associated with clicking this button after running any 'onClick' script.
protected  void doButtonAction(int x, int y)
          do the button Action
 boolean equals(java.lang.Object o)
           
 java.lang.String getType()
          Return the type of the control, as seen from JavaScript.
protected  java.lang.String[] getValues()
          Returns the current value(s) associated with this control.
 int hashCode()
           
static boolean isAllowUnnamedImageButton()
           
 boolean isFake()
          getter for the fake flag Returns true for synthetic submit buttons, created by HttpUnit in forms that contain no submit buttons, or used during WebForm.submitNoButton() call.
 boolean isImageButton()
          Returns true if this submit button is an image map.
 boolean isValidImageButton()
          return whether this is a validImageButton
 java.lang.String positionParameterName(java.lang.String direction)
          return the name of the positionParameter for this button (if this is an image Button)
static void setAllowUnnamedImageButton(boolean allowUnnamedImageButton)
           
 void throwDisabledException()
          throw an exception that I'm disbled
 java.lang.String toString()
           
 
Methods inherited from class com.meterware.httpunit.Button
click, doButtonAction, doOnClickSequence, getParentDelegate, getValue, isDisabled, newScriptable, rememberEnableState, verifyButtonEnabled
 
Methods inherited from class com.meterware.httpunit.FormControl
claimUniqueValue, claimValueIsRequired, doEvent, doEventScript, doOnChangeEvent, doOnClickEvent, doOnMouseDownEvent, doOnMouseUpEvent, emptyIfNull, getAttribute, getAttribute, getClassName, getDisplayedOptions, getForm, getID, getName, getNode, getOptionValues, getScriptingHandler, getTagName, getText, getTitle, getValueAttribute, handleEvent, isHidden, isMultiValued, isReadOnly, isSupportedAttribute, removeAttribute, reset, sendOnChangeEvent, sendOnClickEvent, sendOnMouseDownEvent, sendOnMouseUpEvent, setAttribute, setState, setValueAttribute, supportAttribute, toggle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public java.lang.String getType()
Description copied from class: FormControl
Return the type of the control, as seen from JavaScript.

Overrides:
getType in class Button

isImageButton

public boolean isImageButton()
Returns true if this submit button is an image map.


click

public void click(int x,
                  int y)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Performs the action associated with clicking this button after running any 'onClick' script. For a submit button this typically submits the form.

Throws:
java.io.IOException
org.xml.sax.SAXException
Since:
1.6

doButtonAction

protected void doButtonAction(int x,
                              int y)
                       throws java.io.IOException,
                              org.xml.sax.SAXException
do the button Action

Overrides:
doButtonAction in class Button
Parameters:
x - - x coordinate
y - - y coordinate
Throws:
java.io.IOException
org.xml.sax.SAXException

toString

public java.lang.String toString()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)

isFake

public boolean isFake()
getter for the fake flag Returns true for synthetic submit buttons, created by HttpUnit in forms that contain no submit buttons, or used during WebForm.submitNoButton() call.

Returns:
- whether this button is a faked button inserted by httpunit

getValues

protected java.lang.String[] getValues()
Returns the current value(s) associated with this control. These values will be transmitted to the server if the control is 'successful'.

Overrides:
getValues in class Button

isAllowUnnamedImageButton

public static boolean isAllowUnnamedImageButton()
Returns:
the allowUnnamedImageButton

setAllowUnnamedImageButton

public static void setAllowUnnamedImageButton(boolean allowUnnamedImageButton)
Parameters:
allowUnnamedImageButton - the allowUnnamedImageButton to set

isValidImageButton

public boolean isValidImageButton()
return whether this is a validImageButton

Returns:
true if it is an image Button

positionParameterName

public java.lang.String positionParameterName(java.lang.String direction)
return the name of the positionParameter for this button (if this is an image Button)

Parameters:
direction - e.g. "x" or "y"
Returns:
the name e.g. "image.x" or just "x"

addValues

protected void addValues(com.meterware.httpunit.protocol.ParameterProcessor processor,
                         java.lang.String characterSet)
                  throws java.io.IOException
addValues if not disabled and pressed

Overrides:
addValues in class Button
Parameters:
processor - - the ParameterProcessor used
characterSet - - the active character set
Throws:
java.io.IOException - if addValues fails

throwDisabledException

public void throwDisabledException()
Description copied from class: Button
throw an exception that I'm disbled

Overrides:
throwDisabledException in class Button

Copyright © 2000-2008 Russell Gold. See license agreement for rights granted.