public final class Hidden extends Field
Field.Type
Constructor and Description |
---|
Hidden(String name)
Creates a new text element with the initial value set to an empty string.
|
Hidden(String name,
int value)
Convenience constructor to creates a new hidden element with the
specified initial integer value (converted to a string).
|
Hidden(String name,
List values)
Creates a new hidden element with the specified initial values.
|
Hidden(String name,
String value)
Creates a new hidden element with the specified initial value.
|
Hidden(String name,
String[] values)
Creates a new hidden element with the specified initial values.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 . |
String |
getValue(FormData fd)
Returns a String representing the value of this field or null
if there is no current value.
|
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,
Writer writer) |
void |
reset(FormData fd) |
void |
setValue(String value)
Sets the initial values of this text element.
|
void |
setValue(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.
|
String |
toString() |
add, addError, addLabel, addString, disable, disable, enable, enable, getLabel, getName, getValidateErrors, isEnabled, render, render, render, renderError, renderError, renderStyleTag, setStyleTag, validate
public Hidden(String name)
public Hidden(String name, String value)
public Hidden(String name, int value)
public Hidden(String name, String[] values)
public Field.Type getType()
Field
Field.Type
. This type
is rendered as part of <input type= ...public void renderImpl(FormData fd, Writer writer) throws IOException
renderImpl
in class Field
IOException
public String getValue(FormData fd)
getValues
method. If called when more
than one value exists, this method will return any 1 arbitrary value.public String[] getValues(FormData fd)
public String getStringValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.NumberFormatException
- if the value could not be
returned as in integer.public int getIntValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.NumberFormatException
- if the value could not be
returned as an integer.public short getShortValue(FormData fd)
getValues(fc.web.forms.FormData)
method instead.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 inSubmitHackedException
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].