Package org.opencms.gwt.client.ui.input
Interface I_CmsFormField
- All Known Implementing Classes:
CmsBasicFormField
public interface I_CmsFormField
The interface for a form field.
A form field consists of a widget for entering values, some metadata like a label text/description, and a set of validators for validating the field.
- Since:
- 8.0.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A simple map class containing strings to direct the layout of a form field.static enum
An enum which represents the validation status of a field. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(I_CmsStringModel model) Binds a model object to the form field.Returns the default value for the form field.The description of the form field, or null if there is no description.getId()
Returns the id of this form field, or null if the form field id has not been set.getLabel()
The label of the form field, or null if there is no label.Returns the layout data for this field.getModel()
Returns the model object for this field.Returns the model id.Returns the model value.Returns the validation status of this form field.Returns the validator for this form field, or null if the field has no validator.Returns the widget used by this form field.void
Sets the id of this form field.void
Updates the validation status of this form field.void
setValidator
(I_CmsValidator validator) Sets the validator for this form field.void
unbind()
Removes the binding to this form field's model.
-
Method Details
-
bind
Binds a model object to the form field.- Parameters:
model
- the model object
-
getDefaultValue
Returns the default value for the form field.- Returns:
- the default value for the form field
-
getDescription
The description of the form field, or null if there is no description.- Returns:
- a description string or null
-
getId
Returns the id of this form field, or null if the form field id has not been set. If a form field without an id is added to a form, typically it will receive a synthetic id.- Returns:
- the id
-
getLabel
The label of the form field, or null if there is no label.- Returns:
- a label or null
-
getLayoutData
Returns the layout data for this field.- Returns:
- the layout data for this field
-
getModel
Returns the model object for this field.- Returns:
- the model used for this field
-
getModelId
Returns the model id.- Returns:
- the model id
-
getModelValue
Returns the model value.- Returns:
- the model value
-
getValidationStatus
Returns the validation status of this form field.If the field has no validator, this should always return
valid
.- Returns:
- the validation status
-
getValidator
Returns the validator for this form field, or null if the field has no validator.- Returns:
- a validator or null
-
getWidget
Returns the widget used by this form field.- Returns:
- a widget
-
setId
Sets the id of this form field.- Parameters:
id
- the new id
-
setValidationStatus
Updates the validation status of this form field.This will only have an effect if the field has a validator.
- Parameters:
status
- the new validation status
-
setValidator
Sets the validator for this form field.- Parameters:
validator
- the new validator
-
unbind
void unbind()Removes the binding to this form field's model.
-