|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.web.forms.Field
fc.web.forms.Hidden
public final class Hidden
Represents an HTML hidden field. If this object is created with an array of string values, then each string value will be written out as a seperate hidden field and all such written hidden fields will have the same name. When the form is submitted, all values can be retrieved as an array of strings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class fc.web.forms.Field |
---|
Field.Type |
Constructor Summary | |
---|---|
Hidden(java.lang.String name)
Creates a new text element with the initial value set to an empty string. |
|
Hidden(java.lang.String name,
int value)
Convenience constructor to creates a new hidden element with the specified initial integer value (converted to a string). |
|
Hidden(java.lang.String name,
java.util.List values)
Creates a new hidden element with the specified initial values. |
|
Hidden(java.lang.String name,
java.lang.String value)
Creates a new hidden element with the specified initial value. |
|
Hidden(java.lang.String name,
java.lang.String[] values)
Creates a new hidden element with the specified initial values. |
Method Summary | |
---|---|
boolean |
getBooleanValue(FormData fd)
Convenience method that returns one value of this field as a boolean. |
int |
getIntValue(FormData fd)
Convenience method that returns one value of this field as a Integer. |
short |
getShortValue(FormData fd)
Convenience method that returns one value of this field as a Short. |
java.lang.String |
getStringValue(FormData fd)
Convenience method that returns one value of this field as a String with null values being returned as an empty string). |
Field.Type |
getType()
Subclasses should return an appropriate Field.Type . |
java.lang.String |
getValue(FormData fd)
Returns a String representing the value of this field or null if there is no current value. |
java.lang.String[] |
getValues(FormData fd)
Returns a String[] containing all values associated with this field. |
boolean |
isFilled(FormData fd)
Returns true if this field was isFilled out or selected by the user, false otherwise. |
void |
renderImpl(FormData fd,
java.io.Writer writer)
|
void |
reset(FormData fd)
|
void |
setValue(java.lang.String value)
Sets the initial values of this text element. |
void |
setValue(java.lang.String[] values)
Sets the initial values of this text element. |
void |
setValueFromSubmit(FormData fd,
javax.servlet.http.HttpServletRequest req)
This method sets the value of this field from the parameters obtained from the specified request. |
java.lang.String |
toString()
|
Methods inherited from class fc.web.forms.Field |
---|
add, addError, addLabel, addString, disable, disable, enable, enable, getLabel, getName, getValidateErrors, isEnabled, render, render, render, renderError, renderError, renderStyleTag, setStyleTag, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Hidden(java.lang.String name)
public Hidden(java.lang.String name, java.lang.String value)
public Hidden(java.lang.String name, int value)
public Hidden(java.lang.String name, java.lang.String[] values)
public Hidden(java.lang.String name, java.util.List values)
Method Detail |
---|
public Field.Type getType()
Field
Field.Type
. This type
is rendered as part of <input type= ...
getType
in class Field
public void renderImpl(FormData fd, java.io.Writer writer) throws java.io.IOException
renderImpl
in class Field
java.io.IOException
public java.lang.String getValue(FormData fd)
getValues
method. If called when more
than one value exists, this method will return any 1 arbitrary value.
public java.lang.String[] getValues(FormData fd)
public java.lang.String getStringValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.
java.lang.NumberFormatException
- if the value could not be
returned as in integer.public int getIntValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.
java.lang.NumberFormatException
- if the value could not be
returned as an integer.public short getShortValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.
java.lang.NumberFormatException
- if the value could not be
returned as a short.public boolean getBooleanValue(FormData fd)
Boolean.valueOf(String)
method. If more than one value exists, use the
getValues(fc.web.forms.FormData)
method instead.
public void setValueFromSubmit(FormData fd, javax.servlet.http.HttpServletRequest req) throws SubmitHackedException
Field
setValueFromSubmit
in class Field
fd
- the form data object to store the value in
SubmitHackedException
public void setValue(java.lang.String[] values)
public void setValue(java.lang.String value)
public boolean isFilled(FormData fd)
Field
Note: Some fields like selects will never be empty since non-multiple select fields always send their default selected value. [although select/with/multiple can be empty since the browser sends (much like radio buttoms) nothing at all when no option is selected].
isFilled
in class Field
public void reset(FormData fd)
public java.lang.String toString()
toString
in class Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |