Expresso 5-6

com.jcorporate.expresso.services.html
Class Radio

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

public class Radio
extends HtmlElement

Encapsulates an HTML radio 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
Radio(String newFieldName)
          Constructor Create a new Radio list with the specified field name
Radio(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 radio
protected  void display(PrintWriter out, int depth)
          Display this Radio to the appropriate PrintWriter
 void setCurrentValue(String newCurrentValue)
          Set the currently selected value for this radio
 void setVertical(boolean state)
           
 
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

Radio

public Radio(String newFieldName)
      throws HtmlException
Constructor Create a new Radio 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

Radio

public Radio(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 radio
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 radio

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 Radio to the appropriate PrintWriter

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

setCurrentValue

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

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

setVertical

public void setVertical(boolean state)
Parameters:
state - set to true for vertical radio buttons

Expresso 5-6

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