|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.web.forms.ChoiceGroup.Choice
public static class ChoiceGroup.Choice
Creates a new choice for this choice group.
Also note that unlike other fields, the HTML label/text for this choice
has to be provided via the constructor (as opposed to being written at the
jsp level). See #htmlBeforeField
.
Constructor Summary | |
---|---|
ChoiceGroup.Choice(java.lang.String label,
boolean selected)
Constructs a new unselected choice with the specified label (and no separate value attribute) |
|
ChoiceGroup.Choice(java.lang.String label,
java.lang.String value)
Constructs a new unselected choice with the specified value and HTML text. |
|
ChoiceGroup.Choice(java.lang.String label,
java.lang.String value,
boolean selected)
Creates a new choice object. |
Method Summary | |
---|---|
boolean |
getBooleanValue(FormData fd)
Convenience method that returns the value of this choice as a boolean. |
int |
getIntValue()
Convenience method that returns the value of this choice as a Integer. |
java.lang.String |
getLabel()
Returns the label for this choice. |
short |
getShortValue(FormData fd)
Convenience method that returns the value of this choice as a Short. |
java.lang.String |
getValue()
Returns the value of this choice. |
boolean |
isOrigSelected()
|
void |
labelBeforeField()
By default, the HTML label (if any) is written after the input element tag but calling this method reverses this order. |
void |
render(FormData fd,
java.io.Writer writer,
boolean disabled)
Renders this choice maintaining it's selected state by using the specified form data. |
void |
render(java.io.Writer writer,
boolean selected,
boolean disabled)
Renders this choice with the select state specified by the selected parameter. |
void |
setLabelSeperator(java.lang.String sep)
Sets the seperator between labels and the choice. |
java.lang.String |
toString()
|
void |
writeLabel(boolean val)
Specify true to write the label for this choice, false to skip the label. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChoiceGroup.Choice(java.lang.String label, java.lang.String value, boolean selected)
value
- the value of this choice itemlabel
- the label (any html text) for this choice.selected
- true is this choice is
originally selectedpublic ChoiceGroup.Choice(java.lang.String label, java.lang.String value)
value
- the value of this choice itemlabel
- the label (any html text) for this choicepublic ChoiceGroup.Choice(java.lang.String label, boolean selected)
label
- the label (any html) text for this choiceselected
- true is this choice is
originally selectedMethod Detail |
---|
public void labelBeforeField()
public void writeLabel(boolean val)
public void render(FormData fd, java.io.Writer writer, boolean disabled) throws java.io.IOException
Each choice can be rendered separately which helps in arbitrary
html layout. Choices can also be rendered together via the parent
ChoiceGroup#render(FormData, Writer
method.
java.io.IOException
public void render(java.io.Writer writer, boolean selected, boolean disabled) throws java.io.IOException
Each choice can be rendered separately which helps in arbitrary
html layout. Choices can also be rendered together via the parent
ChoiceGroup#render(FormData, Writer
method.
java.io.IOException
public java.lang.String getValue()
public int getIntValue()
java.lang.NumberFormatException
- if the value could not be
returned as an integer.public short getShortValue(FormData fd)
java.lang.NumberFormatException
- if the value could not be
returned as a short.public boolean getBooleanValue(FormData fd)
Boolean.valueOf(String)
method.
public java.lang.String getLabel()
public void setLabelSeperator(java.lang.String sep)
public boolean isOrigSelected()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |