sdsu.html
Class SelectionList

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

public class SelectionList
extends java.lang.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 Summary
 void append(java.util.Enumeration itemsToDisplay)
          Append an items to the end of the list for display
 void append(java.lang.String itemDisplay)
          Append an item to the end of the list for display
 void append(java.lang.String itemDisplay, java.lang.String value)
          Append an item to the end of the list for display
 void append(java.lang.String itemDisplay, java.lang.String value, boolean selected)
          Append an item to the end of the list.
static SelectionList dropDownMenu(java.lang.String listName)
          Returns a drop down menu for use in a form.
static SelectionList scrolling(java.lang.String listName, int size)
          Returns a scrolling list for use in a form.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

scrolling

public static SelectionList scrolling(java.lang.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

dropDownMenu

public static SelectionList dropDownMenu(java.lang.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

append

public void append(java.lang.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

append

public void append(java.lang.String itemDisplay,
                   java.lang.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

append

public void append(java.lang.String itemDisplay,
                   java.lang.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

append

public void append(java.util.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

toString

public java.lang.String toString()
Specified by:
toString in interface HTML
Overrides:
toString in class java.lang.Object