|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.util.html.HTMLTagAttributes
com.ibm.as400.util.html.RadioFormInputGroup
public class RadioFormInputGroup extends HTMLTagAttributes implements 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:
RadioFormInput,
Serialized Form| Constructor and Description |
|---|
RadioFormInputGroup()
Constructs a default RadioFormInputGroup object. |
RadioFormInputGroup(String name)
Constructs a RadioFormInputGroup object with the specified control name. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(RadioFormInput radioButton)
Adds a radio button to the group. |
RadioFormInput |
add(String name,
String value,
String label,
boolean checked)
Adds a radio button to the group. |
void |
addElementListener(ElementListener listener)
Adds an addElementListener. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
String |
getFOTag()
Returns a comment tag. |
String |
getName()
Returns the control name of the radio group. |
String |
getTag()
Returns the radio button group tag. |
boolean |
isAlignmentVertical()
Indicates if the radio group alignment is vertical. |
void |
remove(RadioFormInput radioButton)
Removes a radio button from the group. |
void |
removeElementListener(ElementListener listener)
Removes this ElementListener from the internal list. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setName(String name)
Sets the control name of the radio group. |
void |
setVerticalAlignment(boolean verticalAlignment)
Sets the alignment of the radio group to vertical. |
| Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes |
|---|
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RadioFormInputGroup()
public RadioFormInputGroup(String name)
name - The group control name.| Method Detail |
|---|
public void add(RadioFormInput radioButton)
radioButton - The radio button.
public RadioFormInput add(String name,
String value,
String label,
boolean checked)
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.public void addElementListener(ElementListener listener)
listener - The ElementListener.removeElementListener(com.ibm.as400.util.html.ElementListener)public void addVetoableChangeListener(VetoableChangeListener listener)
listener - The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)public String getName()
public String getFOTag()
getFOTag in interface HTMLTagElementpublic String getTag()
getTag in interface HTMLTagElementpublic boolean isAlignmentVertical()
public void remove(RadioFormInput radioButton)
radioButton - The radio button.public void removeElementListener(ElementListener listener)
listener - The ElementListener.addElementListener(com.ibm.as400.util.html.ElementListener)public void removeVetoableChangeListener(VetoableChangeListener listener)
listener - The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setName(String name)
throws PropertyVetoException
name - The group control name.PropertyVetoException - If a change is vetoed.
public void setVerticalAlignment(boolean verticalAlignment)
throws PropertyVetoException
verticalAlignment - true if alignment is vertical; false if horizontal.PropertyVetoException - If a change is vetoed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||