Package com.meterware.httpunit

# Class FormControl.Scriptable

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

All Implemented Interfaces:
  `DocumentElement`, `IdentifiedDelegate`, `Input`, `NamedDelegate`, `ScriptingEventHandler`, `ScriptingHandler`

Enclosing class:
  `FormControl`

public class FormControl.Scriptable extends ScriptableDelegate implements Input
implementation of Scriptable input elements

## Field Summary

### Fields inherited from class com.meterware.httpunit.scripting.ScriptableDelegate

`NULL_SCRIPT_ENGINE`

## Constructor Summary

Constructors
Constructor
Description
`Scriptable()`
construct a Scriptable

## Method Summary

Modifier and Type
Method
Description
`void`
`blur()`
simulate blur
`void`
`click()`
allow calling click for this control
`void`
`focus()`
simulate focus;
`Object`
`get(String propertyName)`
get the given property
`protected HTMLElement`
`get_element()`
`String`
`getAttribute(String attributeName)`
get the content of the given attribute
`String`
`getID()`
get my ID
`String`
`getName()`
get my Name
`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`
`sendOnChangeEvent()`
allow firing a sendOnChangeEvent
`void`
`set(String propertyName, Object value)`
set the given property to the given value
`void`
`setAttribute(String attributeName, Object value)`
set the given attribute to the given value

### Methods inherited from class com.meterware.httpunit.scripting.ScriptableDelegate

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

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface com.meterware.httpunit.scripting.Input

`removeAttribute`

## Constructor Details

### Scriptable

public Scriptable()
construct a Scriptable

## Method Details

### getName

public String getName()
get my Name

Specified by:
  `getName` in interface `NamedDelegate`
Returns:
  the name of this scriptable

### getID

public String getID()
get my ID

Specified by:
  `getID` in interface `IdentifiedDelegate`
Returns:
  the id of this scriptable

### get

public Object get(String propertyName)
get the given property

Specified by:
  `get` in interface `Input`
Parameters:
  `propertyName` - - the name of the property to get

### set

public void set(String propertyName, Object value)
set the given property to the given value

Specified by:
  `set` in interface `Input`
Overrides:
  `set` in class `ScriptableDelegate`
Parameters:
  `propertyName` - - the property to set
  `value` - - the value to use

### setAttribute

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

Specified by:
  `setAttribute` in interface `Input`
Parameters:
  `attributeName` - - the name of the attribute to set
  `value` - - the value to use

### click

public void click() throws IOException, SAXException
allow calling click for this control

Specified by:
  `click` in interface `Input`
Throws:
  `IOException`
  `SAXException`

### blur

public void blur()
simulate blur

### focus

public void focus()
simulate focus;

### sendOnChangeEvent

public void sendOnChangeEvent()
allow firing a sendOnChangeEvent

Specified by:
  `sendOnChangeEvent` in interface `Input`

### 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

### 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