public class ButtonFormInput extends FormInput
Here is an example of a ButtonFormInput tag calling a javascript defined within a HTML page:
<input type="button" name="button1" value="Press Me" onclick="test()" />
Here is a sample javascript which displays an alert box with the specified message:
<head> <script language="javascript"> function test() { alert("This is a sample script executed with a ButtonFormInput.") } </script> </head>
ButtonFormInput objects generate the following events:
Constructor and Description |
---|
ButtonFormInput()
Constructs a default ButtonFormInput object.
|
ButtonFormInput(java.lang.String name)
Constructs a ButtonFormInput object with the specified control name.
|
ButtonFormInput(java.lang.String name,
java.lang.String value)
Constructs a ButtonFormInput object with the specified control name and
viewable text value of the button.
|
ButtonFormInput(java.lang.String name,
java.lang.String value,
java.lang.String action)
Constructs a ButtonFormInput object with the specified control name,
viewable text value of the button, and the action to perform
when the button is pressed.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAction()
Returns the action being performed by the button.
|
java.lang.String |
getFOTag()
Returns a comment tag.
|
java.lang.String |
getTag()
Returns the tag for the button form input type.
|
void |
setAction(java.lang.String action)
Sets the action to perform when the button is clicked.
|
addVetoableChangeListener, getDirection, getLanguage, getName, getSize, getValue, removeVetoableChangeListener, setDirection, setLanguage, setName, setSize, setValue, toString
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
public ButtonFormInput()
public ButtonFormInput(java.lang.String name)
name
- The control name of the input field.public ButtonFormInput(java.lang.String name, java.lang.String value)
name
- The control name of the input field.value
- The viewable text value of the button.public ButtonFormInput(java.lang.String name, java.lang.String value, java.lang.String action)
name
- The control name of the input field.value
- The viewable text value of the button.action
- The script to execute.public java.lang.String getAction()
public java.lang.String getFOTag()
public java.lang.String getTag()
public void setAction(java.lang.String action) throws java.beans.PropertyVetoException
action
- The script to execute.java.beans.PropertyVetoException
- If a change is vetoed.