PAJES 2.3.9

org.pajes.html
Class InputRadioButtonSet

java.lang.Object
  extended byorg.pajes.html.Tag
      extended byorg.pajes.html.Input
          extended byorg.pajes.html.InputRadioButtonSet
All Implemented Interfaces:
java.lang.Cloneable, HTML, java.io.Serializable

public class InputRadioButtonSet
extends Input

This class builds a set of HTML radio button tags.

NOTE: JavaScript handlers, read-only flags or style sheet id's defined on the set always over-ride any settings on the individual radio buttons! For example:

  InputRadioButtonSet yn = new InputRadioButtonSet(form, "radio", false);
  yn.add("y", true, "Yes", true);
  yn.add("n", false, "No", true);
  // The following WILL NOT WORK! You can't set the handler of an individual radio item.
  yn.get("y").setOnClickHandler("alert('Yes selected!');");
  // Do it this way instead
  yn.setOnClickHandler("if (this.value == 'y') { alert('Yes selected!') };");
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.pajes.html.Input
TYPE_ATTRIBUTE
 
Fields inherited from class org.pajes.html.Tag
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT
 
Constructor Summary
InputRadioButtonSet(Form form, java.lang.String name, boolean vertical)
          Creates a set of radio buttons.
 
Method Summary
 InputRadioButtonSet add(InputRadio radio)
          Add a radio button to the set.
 InputRadioButtonSet add(java.lang.String value, boolean isChecked)
          Add a radio button to the set.
 InputRadioButtonSet add(java.lang.String value, boolean isChecked, Span displayText, boolean textOnLeft)
          Add a radio button to the set.
 InputRadioButtonSet add(java.lang.String value, boolean isChecked, java.lang.String displayText, boolean textOnLeft)
          Add a radio button to the set.
 InputRadioButtonSet add(java.lang.String value, boolean isChecked, Text displayText, boolean textOnLeft)
          Add a radio button to the set.
 InputRadio get(java.lang.String value)
          Returns the radio button instance that has the specified value.
 Input setValue(java.lang.String value)
          Sets the radio button with the specified value to be checked.
 void write(Browser browser)
          Writes the <input type="radio"> tags to the browser.
 
Methods inherited from class org.pajes.html.Input
addClientValidation, addContent, clone, getClientValidation, getClientValidation, getDOMReference, getFieldNameForErrorMessage, getForm, getInstance, getLabel, getName, getOnBlurHandler, getOnChangeHandler, getOnFocusHandler, getOnSelectHandler, getReadOnlyStyleSheetClass, getTabIndex, getType, getValue, isChangeFlagEnabled, isDisabled, isReadOnly, isRequiringValidation, logNoFormWarning, removeClientValidation, removeClientValidation, removeClientValidation, removeMandatoryClientValidation, setChanged, setChangedFlag, setContent, setDisabled, setFieldNameInErrorMessage, setFieldNameInErrorMessage, setForm, setId, setLabel, setName, setOnBlurHandler, setOnBlurValidation, setOnChangeHandler, setOnClickHandler, setOnFocusHandler, setOnSelectHandler, setReadOnly, setReadOnlyStyleSheetClass, setTabIndex, setTabIndex, setTabIndex
 
Methods inherited from class org.pajes.html.Tag
addAttribute, addAttributes, addAttributes, clearAttribute, clearAttributes, destroy, getAttribute, getAttributes, getAttributeSet, getContainer, getContent, getDocument, getId, getOnClickHandler, getOnDBLClickHandler, getOnKeyDownHandler, getOnKeyPressHandler, getOnKeyUpHandler, getOnMouseDownHandler, getOnMouseOutHandler, getOnMouseOverHandler, getOnMouseUpHandler, getStyle, getStyleSheetClass, getTagName, getTitle, getWritePermission, init, initAttributes, isWritable, isWritable, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setContainer, setContent, setOnDBLClickHandler, setOnKeyDownHandler, setOnKeyPressHandler, setOnKeyUpHandler, setOnMouseDownHandler, setOnMouseOutHandler, setOnMouseOverHandler, setOnMouseUpHandler, setStyle, setStyleSheetClass, setTagName, setTitle, setWritable, setWriteAttributes, setWriteEndTag, setWritelnAfter, setWritelnAfterContent, setWritelnBefore, setWritelnBeforeContent, setWritePermission, toString, writeContent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputRadioButtonSet

public InputRadioButtonSet(Form form,
                           java.lang.String name,
                           boolean vertical)
Creates a set of radio buttons.

Parameters:
form - the form on which this input field will appear. Note that the element must still be added to the form - this reference is used by the getDOMReference() method to determine the fully qualified element name.
name - the name to apply to the radio buttons.
vertical - true if the buttons are to be displayed vertically, or false if they are to be displayed horizontally.
Method Detail

setValue

public Input setValue(java.lang.String value)
Sets the radio button with the specified value to be checked.

Overrides:
setValue in class Input
Parameters:
value - the value returned if the radio button is selected.
Returns:
the modified InputRadioButtonSet.

add

public InputRadioButtonSet add(InputRadio radio)
Add a radio button to the set.

Parameters:
radio - the radio button instance.
Returns:
the modified InputRadioButtonSet.

add

public InputRadioButtonSet add(java.lang.String value,
                               boolean isChecked)
Add a radio button to the set.

Parameters:
value - the value returned if the radio button is selected.
isChecked - Set to true if you want the radio button to be initially selected.
Returns:
the modified InputRadioButtonSet.

add

public InputRadioButtonSet add(java.lang.String value,
                               boolean isChecked,
                               java.lang.String displayText,
                               boolean textOnLeft)
Add a radio button to the set.

Parameters:
value - the value returned if the radio button is selected.
isChecked - Set to true if you want the radio button to be initially selected.
displayText - the text to be displayed next to the radio button.
textOnLeft - true if the text is to be displayed on the left of the radio button, or false if it is to be displayed on the right.
Returns:
the modified InputRadioButtonSet.

add

public InputRadioButtonSet add(java.lang.String value,
                               boolean isChecked,
                               Text displayText,
                               boolean textOnLeft)
Add a radio button to the set.

Parameters:
value - the value returned if the radio button is selected.
isChecked - Set to true if you want the radio button to be initially selected.
displayText - the text to be displayed next to the radio button.
textOnLeft - true if the text is to be displayed on the left of the radio button, or false if it is to be displayed on the right.
Returns:
the modified InputRadioButtonSet.

add

public InputRadioButtonSet add(java.lang.String value,
                               boolean isChecked,
                               Span displayText,
                               boolean textOnLeft)
Add a radio button to the set.

Parameters:
value - the value returned if the radio button is selected.
isChecked - Set to true if you want the radio button to be initially selected.
displayText - the text to be displayed next to the radio button.
textOnLeft - true if the text is to be displayed on the left of the radio button, or false if it is to be displayed on the right.
Returns:
the modified InputRadioButtonSet.

get

public InputRadio get(java.lang.String value)
Returns the radio button instance that has the specified value.

Parameters:
value - the value returned if the radio button is selected.
Returns:
the radio button instance, or null if the value could not be matched.

write

public void write(Browser browser)
           throws java.io.IOException
Writes the <input type="radio"> tags to the browser.

Specified by:
write in interface HTML
Overrides:
write in class Input
Parameters:
browser - the browser to which the results are to be output.
Throws:
java.io.IOException - if an I/O error occurs writing to the browser.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.