Class java.servlet.html.HtmlChoice
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.servlet.html.HtmlChoice

java.lang.Object
   |
   +----java.servlet.html.HtmlContainer
           |
           +----java.servlet.html.HtmlChoice

public class HtmlChoice
extends HtmlContainer
Utility class for generating a Select tag for an HtmlForm.

Constructor Index

 o HtmlChoice(String)
Create a named choice list.
 o HtmlChoice(String, String)
Create a named choice list, with attributes.

Method Index

 o add(String)
Add choice item(s) to the choice list.
 o add(String, boolean)
Add choice to the choice list, with default.
 o add(String, String)
Add choice to the chioce list, with specified attributes.
 o toString()
Output choicelist as a String.
 o write(OutputStream)
Write html formatted stream to OutputStream.

Constructors

 o HtmlChoice
  public HtmlChoice(String name)
Create a named choice list.
Parameters:
name - The name of this select tag.
 o HtmlChoice
  public HtmlChoice(String name,
                    String attribs)
Create a named choice list, with attributes.
Parameters:
name - The name of this select tag
attribs - Other attributes for this select tag

Methods

 o add
  public void add(String choice)
Add choice item(s) to the choice list.
Parameters:
choice - Comma delimmited list of choices.
Overrides:
add in class HtmlContainer
 o add
  public void add(String choice,
                  String attribs)
Add choice to the chioce list, with specified attributes.
Parameters:
choice - The text for this choice.
attribs - Attributes for this option tag.
Overrides:
add in class HtmlContainer
 o add
  public void add(String choice,
                  boolean selected)
Add choice to the choice list, with default.
Parameters:
choice - The text for this choice.
selected - True if this choice is selected by default.
 o write
  public void write(OutputStream out) throws IOException
Write html formatted stream to OutputStream.
Overrides:
write in class HtmlContainer
 o toString
  public String toString()
Output choicelist as a String.
Overrides:
toString in class HtmlContainer

All Packages  Class Hierarchy  This Package  Previous  Next  Index