|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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(java.lang.String text,
java.lang.String value)
Constructs a SelectOption object with the specified viewable text and initial input value. |
|
SelectOption(java.lang.String text,
java.lang.String value,
boolean selected)
Constructs a SelectOption object with the specified viewable text, initial input value, and initial selected value. |
Method Summary | |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the VetoableChangeListener. |
java.lang.String |
getDirection()
Returns the direction of the text interpretation. |
java.lang.String |
getLanguage()
Returns the language of the input element. |
java.lang.String |
getTag()
Returns the select option tag. |
java.lang.String |
getTag(java.lang.String text)
Returns the select option tag with the new viewable option text. |
java.lang.String |
getText()
Returns the viewable option text. |
java.lang.String |
getValue()
Returns the input value used when the field is submitted. |
boolean |
isSelected()
Indicates if the option defaults to being selected. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. |
void |
setDirection(java.lang.String dir)
Sets the direction of the text interpretation. |
void |
setLanguage(java.lang.String lang)
Sets the language of the input tag. |
void |
setSelected(boolean selected)
Sets whether the option defaults as being selected. |
void |
setText(java.lang.String text)
Sets the option text with the specified viewable text. |
void |
setValue(java.lang.String value)
Sets the input value used when the field is submitted. |
java.lang.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(java.lang.String text, java.lang.String value)
text
- The veiwable option text.value
- The input value used when the field is submitted.public SelectOption(java.lang.String text, java.lang.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(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public java.lang.String getDirection()
public java.lang.String getLanguage()
public java.lang.String getTag()
public java.lang.String getTag(java.lang.String text)
text
- The new option text.public java.lang.String getText()
public java.lang.String getValue()
public boolean isSelected()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in class HTMLTagAttributes
listener
- The PropertyChangeListener.HTMLTagAttributes.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void setDirection(java.lang.String dir) throws java.beans.PropertyVetoException
dir
- The direction. One of the following constants
defined in HTMLConstants: LTR or RTL.java.beans.PropertyVetoException
- If a change is vetoed.HTMLConstants
public void setLanguage(java.lang.String lang) throws java.beans.PropertyVetoException
lang
- The language. Example language tags include:
en and en-US.java.beans.PropertyVetoException
- If a change is vetoed.public void setSelected(boolean selected) throws java.beans.PropertyVetoException
selected
- Whether the option defaults as selected.java.beans.PropertyVetoException
- If a change is vetoed.public void setText(java.lang.String text) throws java.beans.PropertyVetoException
text
- The option text.java.beans.PropertyVetoException
- If a change is vetoed.public void setValue(java.lang.String value) throws java.beans.PropertyVetoException
value
- The input value.java.beans.PropertyVetoException
- If a change is vetoed.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |