|
|||||||||||
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.SelectOption
The SelectOption class represents an option in an HTML option form element.
The option form element is then used in an HTML select form element, which represents a group of
selectable options. The trailing slash "/" on the SelectOption tag allows it to conform to
the XHTML specification.
This example creates a SelectOption object named item1 that is initially selected.
SelectOption item1 = new SelectOption("Item1", "item1", true); System.out.println(item1.getTag());
Here is the output of the SelectOption tag:
<option value="item1" selected="selected">Item1</option>
SelectOption objects generate the following events:
SelectFormElement
,
Serialized FormConstructor Summary | |
---|---|
SelectOption()
Constructs a default SelectOption object. |
|
SelectOption(String text,
String value)
Constructs a SelectOption object with the specified viewable text and initial input value. |
|
SelectOption(String text,
String value,
boolean selected)
Constructs a SelectOption object with the specified viewable text, initial input value, and initial selected value. |
Method Summary | |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. |
String |
getDirection()
Returns the direction of the text interpretation. |
String |
getFOTag()
Returns a comment tag. |
String |
getLanguage()
Returns the language of the input element. |
String |
getTag()
Returns the select option tag. |
String |
getTag(String text)
Returns the select option tag with the new viewable option text. |
String |
getText()
Returns the viewable option text. |
String |
getValue()
Returns the input value used when the field is submitted. |
boolean |
isSelected()
Indicates if the option defaults to being selected. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setDirection(String dir)
Sets the direction of the text interpretation. |
void |
setLanguage(String lang)
Sets the language of the input tag. |
void |
setSelected(boolean selected)
Sets whether the option defaults as being selected. |
void |
setText(String text)
Sets the option text with the specified viewable text. |
void |
setValue(String value)
Sets the input value used when the field is submitted. |
String |
toString()
Returns the String representation of the select option tag. |
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes |
---|
addPropertyChangeListener, getAttributes, getAttributeString, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SelectOption()
public SelectOption(String text, String value)
text
- The veiwable option text.value
- The input value used when the field is submitted.public SelectOption(String text, String value, boolean selected)
text
- The viewable option text.value
- The input value used when the field is submitted.selected
- Whether the option defaults as being selected.Method Detail |
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public String getDirection()
public String getLanguage()
public String getFOTag()
getFOTag
in interface HTMLTagElement
public String getTag()
getTag
in interface HTMLTagElement
public String getTag(String text)
text
- The new option text.
public String getText()
public String getValue()
public boolean isSelected()
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in class HTMLTagAttributes
listener
- The PropertyChangeListener.HTMLTagAttributes.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setDirection(String dir) throws PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.
PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setLanguage(String lang) throws PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.
PropertyVetoException
- If a change is vetoed.public void setSelected(boolean selected) throws PropertyVetoException
selected
- Whether the option defaults as selected.
PropertyVetoException
- If a change is vetoed.public void setText(String text) throws PropertyVetoException
text
- The option text.
PropertyVetoException
- If a change is vetoed.public void setValue(String value) throws PropertyVetoException
value
- The input value.
PropertyVetoException
- If a change is vetoed.public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |