/** * Returns the {@link FormControl} defined by this element. * * @return the {@link FormControl} defined by this element, or <code>null</code> if it is not a <a * target="_blank" * href="http://www.w3.org/TR/html401/interact/forms.html#form-controls">control</a>. */ public FormControl getFormControl() { return FormControl.construct(this); }
/** * Replaces the specified {@link FormControl} in this output document. * * <p>The effect of this method is to {@linkplain #register(OutputSegment) register} zero or more * {@linkplain OutputSegment output segments} in the output document as required to reflect * previous modifications to the control's state. The state of a control includes its <a * href="FormControl.html#SubmissionValue">submission value</a>, {@linkplain * FormControl#setOutputStyle(FormControlOutputStyle) output style}, and whether it has been * {@linkplain FormControl#setDisabled(boolean) disabled}. * * <p>The state of the form control should not be modified after this method is called, as there * is no guarantee that subsequent changes either will or will not be reflected in the final * output. A second call to this method with the same parameter is not allowed. It is therefore * recommended to call this method as the last action before the output is generated. * * <p>Although the specifics of the number and nature of the output segments added in any * particular circumstance is not defined in the specification, it can generally be assumed that * only the minimum changes necessary are made to the original document. If the state of the * control has not been modified, calling this method has no effect at all. * * @param formControl the form control to replace. * @see #replace(FormFields) */ public void replace(final FormControl formControl) { formControl.replaceInOutputDocument(this); }