All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class net.strandberg.html.Form

java.lang.Object
   |
   +----net.strandberg.html.Form

public class Form
extends Object
implements HTMLItem
The class Form is used to create HTML Forms

Version:
$Revision: 0.0 $
Author:
Mats Strandberg

Constructor Index

 o Form(String, String)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor.
 o Form(String, String, boolean)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor.
 o Form(String, String, String)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor.
 o Form(String, String, String, boolean)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor.

Method Index

 o addToBody(HTMLItem)
Adds an HTML item to the body of this form
 o addToBody(String)
Adds a string to the body of this form
 o addToPanel(HTMLItem)
Adds an HTML item to the panel of this form.
 o onSubmit(JavaScript)
Sets the function to be called when submitting the form.
 o onSubmit(String)
Sets the function to be called when submitting the form.
 o setBorder(int)
Sets the border of the table in which this form will be generated.
 o setCellSpacing(int)
Sets the cell spacing of the table in which this form will be generated.
 o toHTML()
Returns HTML code presenting this Form.

Constructors

 o Form
 public Form(String method,
             String action)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor. The ENCTYPE parameter of the HTML form will be left out, which defaults to "x-www-form-urlencoded" when the request is sent from the client. The Form will be presented formatted as an HTML Table.

Parameters:
method - the method for sending the request to the server
action - the action to be called (on the server) on submit
 o Form
 public Form(String method,
             String action,
             boolean asTable)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor. The ENCTYPE parameter of the HTML form will be left out, which defaults to "x-www-form-urlencoded" when the request is sent from the client.

Parameters:
method - the method for sending the request to the server
action - the action to be called (on the server) on submit
asTable - tells whether this form should be presented formatted as an HTML Table
 o Form
 public Form(String method,
             String action,
             String encoding)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor. The Form will be presented formatted as an HTML Table.

Parameters:
method - the method for sending the request to the server
action - the action to be called (on the server) on submit
encoding - will set the ENCTYPE parameter of this form. Could be e.g. "x-www-form-urlencoded" or "multipart/form-data".
 o Form
 public Form(String method,
             String action,
             String encoding,
             boolean asTable)
Constructs a new Form which will be representing an HTML Form according to the arguments given to the constructor.

Parameters:
method - the method for sending the request to the server
action - the action to be called (on the server) on submit
encoding - will set the ENCTYPE parameter of this form. Could be e.g. "x-www-form-urlencoded" or "multipart/form-data".
asTable - tells whether this form should be presented formatted as an HTML Table

Methods

 o onSubmit
 public void onSubmit(String toDo)
Sets the function to be called when submitting the form.

Parameters:
toDo - function to call on submit (before submitting)
 o onSubmit
 public void onSubmit(JavaScript toDo)
Sets the function to be called when submitting the form.

Parameters:
toDo - function to call on submit (before submitting)
 o setBorder
 public void setBorder(int border)
Sets the border of the table in which this form will be generated. Setting the border (which is 0 by default) will have no effect on a form that was not created to be generated as a table.

Parameters:
border - the thickness of the table border
 o setCellSpacing
 public void setCellSpacing(int cellSpacing)
Sets the cell spacing of the table in which this form will be generated. Setting the cell spacing (which is 0 by default) will have no effect on a form that was not created to be generated as a table.

Parameters:
cellSpacing - the thickness of the table border
 o addToBody
 public void addToBody(HTMLItem item)
Adds an HTML item to the body of this form

Parameters:
item - HTMLItem to add
 o addToBody
 public void addToBody(String s)
Adds a string to the body of this form

Parameters:
s - string to add
 o addToPanel
 public void addToPanel(HTMLItem item)
Adds an HTML item to the panel of this form. The panel will be generated as a separate, centered part at the bottom end of the form

Parameters:
item - HTMLItem to add
 o toHTML
 public String toHTML()
Returns HTML code presenting this Form.


All Packages  Class Hierarchy  This Package  Previous  Next  Index