public static final class Select.Option extends Object
Constructor and Description |
---|
Option(String text)
Constructs a new unselected option with the specified
html text and no separate value.
|
Option(String text,
boolean selected)
Constructs a new option with the specified text (and no
separate value tag).
|
Option(String text,
String value)
Constructs a new unselected option with the specified
text and value of the option tag.
|
Option(String text,
String value,
boolean selected)
Constructs a new option with the specified text and
value of the option tag.
|
Modifier and Type | Method and Description |
---|---|
String |
getValue()
Returns the value of this option tag.
|
String |
render(boolean selected) |
String |
toString() |
public Option(String text, String value, boolean selected)
text
- the html text of the option tagvalue
- the value of the option tagselected
- true if this option is selected
by default. If more than one selected option
is added to a select field and that select
field does not have it's multiple attribute
set, then the option displayed as selected is
browser dependent (Moz1, IE6 show
the last selected, N4 the first). More than one
selected option should not be shown for non multiple
select fields anyway.public Option(String text, String value)
text
- the html text of the option tagvalue
- the value of the option tagpublic Option(String text, boolean selected)
text
- the html text of the option tagselected
- true to select this option
false otherwise