Expresso 5-6

com.jcorporate.expresso.services.html
Class DropDown

java.lang.Object
  extended bycom.jcorporate.expresso.services.html.HtmlElement
      extended bycom.jcorporate.expresso.services.html.DropDown

public class DropDown
extends HtmlElement

Encapsulates an HTML drop-down box on an HTML form

Version:
$Revision: 1.8 $ $Date: 2004/11/17 20:48:18 $
Author:
Michael P. Nash

Field Summary
 
Fields inherited from class com.jcorporate.expresso.services.html.HtmlElement
attributes, contents, cSSClass, cSSID
 
Constructor Summary
DropDown(String newFieldName)
          Constructor Create a new DropDown list with the specified field name
DropDown(String newFieldName, String newCurrentValue)
          Create a drop down with the field name as given with a specific current value
 
Method Summary
 void addOption(String fieldValue, String fieldLabel)
          Add a new option to this drop-down
protected  void display(PrintWriter out, int depth)
          Display this DropDown to the appropriate PrintWriter
 void setCurrentValue(String newCurrentValue)
          Set the currently selected value for this drop-down
 
Methods inherited from class com.jcorporate.expresso.services.html.HtmlElement
add, display, finalize, getAttribute, getContentCount, getCSSClass, getName, padWithTabs, setAttribute, setCSSClass, setCSSID, setDisplayed, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DropDown

public DropDown(String newFieldName)
         throws HtmlException
Constructor Create a new DropDown list with the specified field name

Parameters:
newFieldName - Field name of the new drop down, must not be null
Throws:
HtmlException - If the parameter is invalid

DropDown

public DropDown(String newFieldName,
                String newCurrentValue)
         throws HtmlException
Create a drop down with the field name as given with a specific current value

Parameters:
newFieldName - Field name of the new drop-down
newCurrentValue - Current value of the drop down (selected item)
Throws:
HtmlException - If the parameters are invalid
Method Detail

addOption

public void addOption(String fieldValue,
                      String fieldLabel)
               throws HtmlException
Add a new option to this drop-down

Parameters:
fieldValue - Value of the new option
fieldLabel - Label of the new option
Throws:
HtmlException - If the parameters are invalid

display

protected void display(PrintWriter out,
                       int depth)
                throws HtmlException
Display this DropDown to the appropriate PrintWriter

Specified by:
display in class HtmlElement
Parameters:
out - PrintWriter to display
depth - the number of tabs to indent
Throws:
HtmlException - If the DropDown cannot be displayed

setCurrentValue

public void setCurrentValue(String newCurrentValue)
                     throws HtmlException
Set the currently selected value for this drop-down

Parameters:
newCurrentValue - The value for this drop down
Throws:
HtmlException - If the parameter is invalid

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.