All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.html.SelectionList

java.lang.Object
   |
   +----sdsu.html.SelectionList

public class SelectionList
extends Object
implements HTML
Create a dropdown menu or a scrollable list in an html form. Examples of each:
Scrollable list

Dropdown menu

Must be used in a form. Item user selects in reported as ListName=valueOfSelectedItem. Where ListName is the name given to the list, and valueOfSelectedItem is the value given to the selected item, or the display string of item if no value was given.

Use static methods SelectionList.scrolling(...) and SelectionList.dropDownMenu(...) to create instances of this class.

Version:
0.8 6 April 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Method Index

 o append(Enumeration)
Append an items to the end of the list for display
 o append(String)
Append an item to the end of the list for display
 o append(String, String)
Append an item to the end of the list for display
 o append(String, String, boolean)
Append an item to the end of the list.
 o dropDownMenu(String)
Returns a drop down menu for use in a form.
 o scrolling(String, int)
Returns a scrolling list for use in a form.
 o toString()

Methods

 o scrolling
 public static SelectionList scrolling(String listName,
                                       int size)
Returns a scrolling list for use in a form.

Parameters:
listName - name in naem-value cgi pair sent to cgi program when an item is selected in this list
size - number of items, one per line, that can be seen by the user at one time, must be greater than one
 o dropDownMenu
 public static SelectionList dropDownMenu(String listName)
Returns a drop down menu for use in a form.

Parameters:
listName - name in naem-value cgi pair sent to cgi program when an item is selected in this list
 o append
 public void append(String itemDisplay)
Append an item to the end of the list for display

Parameters:
itemDisplay - string that user will see in the list and the value return if this item is selected by user
 o append
 public void append(String itemDisplay,
                    String value)
Append an item to the end of the list for display

Parameters:
itemDisplay - string that user will see in the list
value - the value returned if this item is selected by user
 o append
 public void append(String itemDisplay,
                    String value,
                    boolean selected)
Append an item to the end of the list. This item will be displayed as selected when user first sees the form

Parameters:
itemDisplay - string that user will see in the list, special characters in itemDisplay are escaped for you
value - the value returned if this item is selected by user, if value is null or an empty string then itemDisplay is used as return value
selected - true indicates the item will appear as selected
 o append
 public void append(Enumeration itemsToDisplay)
Append an items to the end of the list for display

Parameters:
itemsToDisplay - Enumeration containing items that user will see in the list and the values returned
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index