Class FormControl

All Implemented Interfaces:
CharSequence, Comparable<Segment>

public abstract class FormControl extends Segment
Represents an HTML form control.

A FormControl consists of a single element that matches one of the form control types.

The term output element is used to describe the element that is output if this form control is replaced in an OutputDocument.

A predefined value control is a form control for which getFormControlType().hasPredefinedValue() returns true. It has a control type of CHECKBOX, RADIO, BUTTON, SUBMIT, IMAGE, SELECT_SINGLE or SELECT_MULTIPLE.

A user value control is a form control for which getFormControlType().hasPredefinedValue() returns false. It has a control type of FILE, HIDDEN, PASSWORD, TEXT or TEXTAREA.

The functionality of most significance to users of this class relates to the display characteristics of the output element, manipulated using the setDisabled(boolean) and setOutputStyle(FormControlOutputStyle) methods.

As a general rule, the operations dealing with the control's submission values are better performed on a FormFields or FormField object, which provide a more intuitive interface by grouping form controls of the same 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 RADIO control with a given name is checked at a time.

A FormFields object can be directly constructed from a collection of FormControl objects.

FormControl instances are obtained using the Element.getFormControl() method or are created automatically with the creation of a FormFields object via the Segment.getFormFields() method.

See Also: