A FormControl
consists of a single {@linkplain #getElement() element}that matches one of the {@linkplain FormControlType form control types}.
The term output element is used to describe the element that is {@linkplain OutputSegment#writeTo(Writer) output} if this form control is {@linkplain OutputDocument#replace(FormControl) replaced}in an {@link OutputDocument}.
A predefined value control is a form control for which {@link #getFormControlType()}. {@link FormControlType#hasPredefinedValue() hasPredefinedValue()}returns true
. It has a {@linkplain #getFormControlType() control type} of{@link FormControlType#CHECKBOX CHECKBOX}, {@link FormControlType#RADIO RADIO}, {@link FormControlType#BUTTON BUTTON}, {@link FormControlType#SUBMIT SUBMIT}, {@link FormControlType#IMAGE IMAGE}, {@link FormControlType#SELECT_SINGLE SELECT_SINGLE}or {@link FormControlType#SELECT_MULTIPLE SELECT_MULTIPLE}.
A user value control is a form control for which {@link #getFormControlType()}. {@link FormControlType#hasPredefinedValue() hasPredefinedValue()}returns false
. It has a {@linkplain #getFormControlType() control type} of{@link FormControlType#FILE FILE}, {@link FormControlType#HIDDEN HIDDEN}, {@link FormControlType#PASSWORD PASSWORD}, {@link FormControlType#TEXT TEXT} or {@link FormControlType#TEXTAREA TEXTAREA}.
The functionality of most significance to users of this class relates to the display characteristics of the output element, manipulated using the {@link #setDisabled(boolean)} and {@link #setOutputStyle(FormControlOutputStyle)} methods.
As a general rule, the operations dealing with the control's submission values are better performed on a {@link FormFields} or {@link FormField} object, which provide a moreintuitive interface by grouping form controls of the same {@linkplain #getName() name} together.The higher abstraction level of these classes means they can automatically ensure that the submission values of their constituent controls are consistent with each other, for example by ensuring that only one {@link FormControlType#RADIO RADIO} control with a given name is{@link #isChecked() checked} at a time.
A {@link FormFields} object can be directly {@linkplain FormFields#FormFields(Collection) constructed} froma collection of FormControl
objects.
FormControl
instances are obtained using the {@link Element#getFormControl()} method or are created automaticallywith the creation of a {@link FormFields} object via the {@link Segment#getFormFields()} method.
@see FormControlType
@see FormFields
@see FormField
|
|