Class Choice
java.lang.Object
fc.web.forms.Field
fc.web.forms.Choice
- 
Nested Class SummaryNested classes/interfaces inherited from class FieldField.Type
- 
Method SummaryModifier and TypeMethodDescriptionbooleanConvenience method that returns the value of this field as a boolean.intgetIntValue(FormData fd) Convenience method that returns the value of this field as a Integer.shortConvenience method that returns the value of this field as a Short.abstract Field.TypegetType()Subclasses should return an appropriateField.Type.Returns the current value of this field.booleanReturns true if this field was isFilled out or selected by the user, false otherwise.voidrenderImpl(FormData fd, Writer writer) voidsetSelected(boolean select) Sets the initial selection status for this field.voidConvenience method that sets this choice to be selected/non-selected.voidSets the selected or non-selected state for this choice in the specified form data.voidSets the value for this choice.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 Fieldadd, addError, addLabel, addString, disable, disable, enable, enable, getLabel, getName, getValidateErrors, isEnabled, render, render, render, renderError, renderError, renderStyleTag, setStyleTag, validate
- 
Method Details- 
getTypeDescription copied from class:FieldSubclasses should return an appropriateField.Type. This type is rendered as part of <input type= ...
- 
getValueReturns the current value of this field. This can be:
- null: if no value is currently set which can happen if this field was not selected when the parent form was submitted. Browsers send nothing at all if choice type fields are not selected in an HTML form.
- the value attribute of this field (if this choice field was created/displayed with a value attribute) or the string "on" (which is sent by browsers if there is no specific value attribute for this choice field). Note, the default value should be treated as case insensitive, since browsers can send on, ON etc.
- 
setValueSets the selected or non-selected state for this choice in the specified form data. Selected choices are returned by the browser as on, ON, oN etc., the value returned is not important as long as something is returned. Therefore any non-null value set by this method will have the effect of selecting this choice when it is rendered. A null value wil unselect this choice.- Parameters:
- fd- a non-null form data object
- value- any non-null value
 
- 
setValue
- 
setValue
- 
getIntValueConvenience method that returns the value of this field as a Integer.- Throws:
- NumberFormatException- if the value could not be returned as in integer.
 
- 
getShortValueConvenience method that returns the value of this field as a Short.- Throws:
- NumberFormatException- if the value could not be returned as a short.
 
- 
getBooleanValueConvenience method that returns the value of this field as a boolean. The returned value will be true if the submitted value is "true" or "on" (both case insensitive), else false
- 
setValueFromSubmitpublic 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 class- Field
- Parameters:
- fd- the form data object to store the value in
- Throws:
- SubmitHackedException
 
- 
renderImpl- Specified by:
- renderImplin class- Field
- Throws:
- IOException
 
- 
isFilledDescription 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]. 
- 
setSelectedSets the initial selection status for this field.- Parameters:
- select- true if this field should be selected false otherwise.
 
- 
toString
 
-