# Class WebForm.Scriptable

java.lang.Object
com.meterware.httpunit.scripting.ScriptableDelegate
com.meterware.httpunit.WebForm.Scriptable

All Implemented Interfaces:
  `DocumentElement, FormScriptable, NamedDelegate, ScriptingEventHandler, ScriptingHandler`

Enclosing class:
  `WebForm`

public class WebForm.Scriptable extends ScriptableDelegate implements NamedDelegate, FormScriptable

Author:
  Russell Gold

## Field Summary

### Fields inherited from class ScriptableDelegate

`NULL_SCRIPT_ENGINE`

## Method Summary

Modifier and Type
Method
Description
`Object`
`get(String propertyName)`
get the Object for the given propertyName
`protected HTMLElement`
`get_element()`
`String`
`getAction()`
`String`
`getAttribute(String attributeName)`
get the content of the given attribute
`ScriptableDelegate[]`
`getElementDelegates()`
`ScriptableDelegate[]`
`getElementsByTagName(String name)`
`String`
`getName()`
`boolean`
`handleEvent(String eventName)`
Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.
`void`
`removeAttribute(String attributeName)`
remove the given attribute
`void`
`reset()`
`void`
`set(String propertyName, Object value)`
Sets the value of the named property.
`void`
`setAction(String newAction)`
set the action
`void`
`setAttribute(String attributeName, Object value)`
set the attribute with the given attribute name to the given value
`void`
`setParameterValue(String name, String value)`
set the value of a parameter
`void`
`submit()`

### Methods inherited from class ScriptableDelegate

`clearCaches, doEvent, doEventScript, evaluateExpression, get, getDelegates, getScriptEngine, getScriptEngine, runScript, setScriptEngine, supportsScriptLanguage`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface ScriptingEventHandler

`doEvent, doEventScript, handleEvent`

## Method Details

### getAction

public String getAction()

### setAction

public void setAction(String newAction)
Description copied from interface: `FormScriptable`
set the action

Specified by:
  `setAction` in interface `FormScriptable`
Parameters:
  `newAction` -

### submit

public void submit() throws IOException, SAXException

Throws:
  `IOException`
  `SAXException`

### reset

public void reset() throws IOException, SAXException

Throws:
  `IOException`
  `SAXException`

### getName

public String getName()

Specified by:
  `getName` in interface `NamedDelegate`

### get

public Object get(String propertyName)
get the Object for the given propertyName

Parameters:
  `propertyName` - - the name of the property to get
Returns:
  the Object for the property

### set

public void set(String propertyName, Object value)
Sets the value of the named property. Will throw a runtime exception if the property does not exist or cannot accept the specified value.

Overrides:
  `set` in class `ScriptableDelegate`
Parameters:
  `propertyName` - - the name of the property
  `value` - - the new value

### setParameterValue

public void setParameterValue(String name, String value)
Description copied from interface: `FormScriptable`
set the value of a parameter

Specified by:
  `setParameterValue` in interface `FormScriptable`
Parameters:
  `name` - - the name of the parameter to set
  `value` - - the value to use for the parameter

### getElementDelegates

public ScriptableDelegate[] getElementDelegates()

### getElementsByTagName

public ScriptableDelegate[] getElementsByTagName(String name) throws SAXException

Throws:
  `SAXException`

### get_element

protected HTMLElement get_element()

Returns:
  the _element

### getAttribute

public String getAttribute(String attributeName)
get the content of the given attribute

Parameters:
  `attributeName` -
Returns:
  the attribute as a string

### setAttribute

public void setAttribute(String attributeName, Object value)
set the attribute with the given attribute name to the given value

Parameters:
  `attributeName` -
  `value` -

### removeAttribute

public void removeAttribute(String attributeName)
remove the given attribute

Parameters:
  `attributeName` -

### handleEvent

public boolean handleEvent(String eventName)
Description copied from class: `ScriptableDelegate`
Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.

Specified by:
  `handleEvent` in interface `ScriptingEventHandler`
Overrides:
  `handleEvent` in class `ScriptableDelegate`
Parameters:
  `eventName` - the name of the event for which a handler should be run.
Returns:
  whether the event with the given name was handled