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
Nested Classes Modifier and Type Interface Description static class
I_CmsFormField.LayoutData
A simple map class containing strings to direct the layout of a form field.static class
I_CmsFormField.ValidationStatus
An enum which represents the validation status of a field.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bind(I_CmsStringModel model)
Binds a model object to the form field.java.lang.Object
getDefaultValue()
Returns the default value for the form field.java.lang.String
getDescription()
The description of the form field, or null if there is no description.java.lang.String
getId()
Returns the id of this form field, or null if the form field id has not been set.java.lang.String
getLabel()
The label of the form field, or null if there is no label.I_CmsFormField.LayoutData
getLayoutData()
Returns the layout data for this field.I_CmsStringModel
getModel()
Returns the model object for this field.java.lang.String
getModelId()
Returns the model id.java.lang.String
getModelValue()
Returns the model value.I_CmsFormField.ValidationStatus
getValidationStatus()
Returns the validation status of this form field.I_CmsValidator
getValidator()
Returns the validator for this form field, or null if the field has no validator.I_CmsFormWidget
getWidget()
Returns the widget used by this form field.void
setId(java.lang.String id)
Sets the id of this form field.void
setValidationStatus(I_CmsFormField.ValidationStatus status)
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 Detail
-
bind
void bind(I_CmsStringModel model)
Binds a model object to the form field.- Parameters:
model
- the model object
-
getDefaultValue
java.lang.Object getDefaultValue()
Returns the default value for the form field.- Returns:
- the default value for the form field
-
getDescription
java.lang.String getDescription()
The description of the form field, or null if there is no description.- Returns:
- a description string or null
-
getId
java.lang.String 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
java.lang.String getLabel()
The label of the form field, or null if there is no label.- Returns:
- a label or null
-
getLayoutData
I_CmsFormField.LayoutData getLayoutData()
Returns the layout data for this field.- Returns:
- the layout data for this field
-
getModel
I_CmsStringModel getModel()
Returns the model object for this field.- Returns:
- the model used for this field
-
getModelId
java.lang.String getModelId()
Returns the model id.- Returns:
- the model id
-
getModelValue
java.lang.String getModelValue()
Returns the model value.- Returns:
- the model value
-
getValidationStatus
I_CmsFormField.ValidationStatus 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
I_CmsValidator getValidator()
Returns the validator for this form field, or null if the field has no validator.- Returns:
- a validator or null
-
getWidget
I_CmsFormWidget getWidget()
Returns the widget used by this form field.- Returns:
- a widget
-
setId
void setId(java.lang.String id)
Sets the id of this form field.- Parameters:
id
- the new id
-
setValidationStatus
void setValidationStatus(I_CmsFormField.ValidationStatus status)
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
void setValidator(I_CmsValidator validator)
Sets the validator for this form field.- Parameters:
validator
- the new validator
-
unbind
void unbind()
Removes the binding to this form field's model.
-
-