All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.util.html.RadioFormInputGroup
java.lang.Object
|
+----com.ibm.as400.util.html.RadioFormInputGroup
- public class RadioFormInputGroup
- extends Object
- implements HTMLTagElement, Serializable
The RadioFormInputGroup class represents a group of RadioFormInput objects. Only one
RadioFormInput object can be checked in the group. The trailing slash "/" on the
RadioFormInputGroup tag allows it to conform to the XHTML specification.
This example creates a radio button group and prints out the tag.
// Create some radio buttons.
RadioFormInput radio0 = new RadioFormInput("age", "kid", "0-12", true);
RadioFormInput radio1 = new RadioFormInput("age", "teen", "13-19", false);
RadioFormInput radio2 = new RadioFormInput("age", "twentysomething", "20-29", false);
RadioFormInput radio3 = new RadioFormInput("age", "thirtysomething", "30-39", false);
// Create a radio button group and add the radio buttons.
RadioFormInputGroup ageGroup = new RadioFormInputGroup("age");
ageGroup.add(radio0);
ageGroup.add(radio1);
ageGroup.add(radio2);
ageGroup.add(radio3);
System.out.println(ageGroup.getTag());
Here is the output of the RadioFormInputGroup tag:
<input type="radio" name="age" value="kid" checked="checked" /> 0-12
<input type="radio" name="age" value="teen" /> 13-19
<input type="radio" name="age" value="twentysomething" /> 20-29
<input type="radio" name="age" value="thirtysomething" /> 30-39
RadioFormInputGroup objects generate the following events:
- ElementEvent - The events fired are:
- elementAdded
- elementRemoved
- PropertyChangeEvent
- VetoableChangeEvent
- See Also:
- RadioFormInput
-
RadioFormInputGroup()
- Constructs a default RadioFormInputGroup object.
-
RadioFormInputGroup(String)
- Constructs a RadioFormInputGroup object with the specified control name.
-
add(RadioFormInput)
- Adds a radio button to the group.
-
add(String, String, String, boolean)
- Adds a radio button to the group.
-
addElementListener(ElementListener)
- Adds an addElementListener.
-
addPropertyChangeListener(PropertyChangeListener)
-
Adds a PropertyChangeListener.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds the VetoableChangeListener.
-
getName()
- Returns the control name of the radio group.
-
getTag()
- Returns the radio button group tag.
-
isAlignmentVertical()
- Indicates if the radio group alignment is vertical.
-
remove(RadioFormInput)
- Removes a radio button from the group.
-
removeElementListener(ElementListener)
- Removes this ElementListener from the internal list.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes the PropertyChangeListener from the internal list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes the VetoableChangeListener from the internal list.
-
setName(String)
- Sets the control name of the radio group.
-
setVerticalAlignment(boolean)
- Sets the alignment of the radio group to vertical.
RadioFormInputGroup
public RadioFormInputGroup()
- Constructs a default RadioFormInputGroup object.
RadioFormInputGroup
public RadioFormInputGroup(String name)
- Constructs a RadioFormInputGroup object with the specified control name.
- Parameters:
- name - The group control name.
add
public void add(RadioFormInput radioButton)
- Adds a radio button to the group. If the group does not have a name, the
name of the first radio button added will also be the group name.
- Parameters:
- radioButton - The radio button.
add
public RadioFormInput add(String name,
String value,
String label,
boolean checked)
- Adds a radio button to the group. If the group does not have a name, the
name of the first radio button added will also be the group name.
- Parameters:
- name - The control name of the input field.
- value - The input value used when the field is submitted.
- label - The viewable text label.
- checked - If the radio button initializes to checked.
- Returns:
- A RadioFormInput object.
addElementListener
public void addElementListener(ElementListener listener)
- Adds an addElementListener.
The specified addElementListeners elementAdded method will
be called each time a radioforminput is added to the group.
The addElementListener object is addded to a list of addElementListeners
managed by this RadioFormInputGroup. It can be removed with removeElementListener.
- Parameters:
- listener - The ElementListener.
- See Also:
- removeElementListener
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a PropertyChangeListener. The specified PropertyChangeListener's
propertyChange method will be called each time the value of any
bound property is changed.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds the VetoableChangeListener. The specified VetoableChangeListener's
vetoableChange method will be called each time the value of any
constrained property is changed.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- removeVetoableChangeListener
getName
public String getName()
- Returns the control name of the radio group.
- Returns:
- The group control name.
getTag
public String getTag()
- Returns the radio button group tag.
- Returns:
- The tag.
isAlignmentVertical
public boolean isAlignmentVertical()
- Indicates if the radio group alignment is vertical.
The default value is false.
- Returns:
- true if vertical; horizontal otherwise.
remove
public void remove(RadioFormInput radioButton)
- Removes a radio button from the group.
- Parameters:
- radioButton - The radio button.
removeElementListener
public void removeElementListener(ElementListener listener)
- Removes this ElementListener from the internal list.
If the ElementListener is not on the list, nothing is done.
- Parameters:
- listener - The ElementListener.
- See Also:
- addElementListener
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes the PropertyChangeListener from the internal list.
If the PropertyChangeListener is not on the list, nothing is done.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes the VetoableChangeListener from the internal list.
If the VetoableChangeListener is not on the list, nothing is done.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- addVetoableChangeListener
setName
public void setName(String name) throws PropertyVetoException
- Sets the control name of the radio group.
- Parameters:
- name - The group control name.
- Throws: PropertyVetoException
- If a change is vetoed.
setVerticalAlignment
public void setVerticalAlignment(boolean verticalAlignment) throws PropertyVetoException
- Sets the alignment of the radio group to vertical.
The default is false.
- Parameters:
- verticalAlignment - true if alignment is vertical; false if horizontal.
- Throws: PropertyVetoException
- If a change is vetoed.
All Packages Class Hierarchy This Package Previous Next Index