All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.util.html.ButtonFormInput

java.lang.Object
   |
   +----com.ibm.as400.util.html.FormInput
           |
           +----com.ibm.as400.util.html.ButtonFormInput

public class ButtonFormInput
extends FormInput
The ButtonFormInput class represents a button input type in an HTML form. The trailing slash "/" on the ButtonFormInput tag allows it to conform to the XHTML specification.

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 Index

 o ButtonFormInput()
Constructs a default ButtonFormInput object.
 o ButtonFormInput(String)
Constructs a ButtonFormInput object with the specified control name.
 o ButtonFormInput(String, String)
Constructs a ButtonFormInput object with the specified control name and viewable text value of the button.
 o ButtonFormInput(String, String, String)
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.

Method Index

 o getAction()
Returns the action being performed by the button.
 o getTag()
Returns the tag for the button form input type.
 o setAction(String)
Sets the action to perform when the button is clicked.

Constructors

 o ButtonFormInput
 public ButtonFormInput()
Constructs a default ButtonFormInput object.

 o ButtonFormInput
 public ButtonFormInput(String name)
Constructs a ButtonFormInput object with the specified control name.

Parameters:
name - The control name of the input field.
 o ButtonFormInput
 public ButtonFormInput(String name,
                        String value)
Constructs a ButtonFormInput object with the specified control name and viewable text value of the button.

Parameters:
name - The control name of the input field.
value - The viewable text value of the button.
 o ButtonFormInput
 public ButtonFormInput(String name,
                        String value,
                        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.

Parameters:
name - The control name of the input field.
value - The viewable text value of the button.
action - The script to execute.

Methods

 o getAction
 public String getAction()
Returns the action being performed by the button.

Returns:
The script being executed.
 o getTag
 public String getTag()
Returns the tag for the button form input type.

Returns:
The tag.
Overrides:
getTag in class FormInput
 o setAction
 public void setAction(String action) throws PropertyVetoException
Sets the action to perform when the button is clicked. Buttons have no default behavior. Each button may have client-side scripts associated with the element's event attributes. When an event occurs (the user presses the button), the associated script is triggered.

Parameters:
action - The script to execute.
Throws: PropertyVetoException
If a change is vetoed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index