Class Hidden
java.lang.Object
fc.web.forms.Field
fc.web.forms.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 Field
Field.Type -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new text element with the initial value set to an empty string.Convenience constructor to creates a new hidden element with the specified initial integer value (converted to a string).Creates a new hidden element with the specified initial value.Creates a new hidden element with the specified initial values.Creates a new hidden element with the specified initial values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanConvenience method that returns one value of this field as a boolean.intgetIntValue(FormData fd) Convenience method that returns one value of this field as a Integer.shortConvenience method that returns one value of this field as a Short.Convenience method that returns one value of this field as a String with null values being returned as an empty string).getType()Subclasses should return an appropriateField.Type.Returns a String representing the value of this field or null if there is no current value.String[]Returns a String[] containing all values associated with this field.booleanReturns true if this field was isFilled out or selected by the user, false otherwise.voidrenderImpl(FormData fd, Writer writer) voidvoidSets the initial values of this text element.voidSets the initial values of this text element.voidsetValueFromSubmit(FormData fd, jakarta.servlet.http.HttpServletRequest req) This method sets the value of this field from the parameters obtained from the specified request.toString()Methods inherited from class Field
add, addError, addLabel, addString, disable, disable, enable, enable, getLabel, getName, getValidateErrors, isEnabled, render, render, render, renderError, renderError, renderStyleTag, setStyleTag, validate
-
Constructor Details
-
Hidden
-
Hidden
-
Hidden
-
Hidden
-
Hidden
-
-
Method Details
-
getType
Description copied from class:FieldSubclasses should return an appropriateField.Type. This type is rendered as part of <input type= ... -
renderImpl
- Specified by:
renderImplin classField- Throws:
IOException
-
getValue
Returns a String representing the value of this field or null if there is no current value. If more than one value exists for this hidden field, use thegetValues(fc.web.forms.FormData)method. If called when more than one value exists, this method will return any 1 arbitrary value. -
getValues
-
getStringValue
Convenience method that returns one value of this field as a String with null values being returned as an empty string). If more than one value exists, use thegetValues(FormData)method instead.- Throws:
NumberFormatException- if the value could not be returned as in integer.
-
getIntValue
Convenience method that returns one value of this field as a Integer. If more than one value exists, use thegetValues(FormData)method instead.- Throws:
NumberFormatException- if the value could not be returned as an integer.
-
getShortValue
Convenience method that returns one value of this field as a Short. If more than one value exists, use thegetValues(FormData)method instead.- Throws:
NumberFormatException- if the value could not be returned as a short.
-
getBooleanValue
Convenience method that returns one value of this field as a boolean. The value is converted into a boolean as per the invalid input: '{@link Boolean.valueOf(String)'} method. If more than one value exists, use thegetValues(FormData)method instead. -
setValueFromSubmit
public void setValueFromSubmit(FormData fd, jakarta.servlet.http.HttpServletRequest req) throws SubmitHackedException Description copied from class:FieldThis method sets the value of this field from the parameters obtained from the specified request. The name of the parameter to obtain this value will typically be the name of this field itself.- Specified by:
setValueFromSubmitin classField- Parameters:
fd- the form data object to store the value in- Throws:
SubmitHackedException
-
setValue
-
setValue
-
isFilled
Description copied from class:FieldReturns true if this field was isFilled out or selected by the user, false otherwise.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].
-
reset
-
toString
-