new FormFieldBase(params)
Constructor for FormFieldBase.
Parameters:
| Name | Type | Description |
|---|---|---|
params |
object | The parameters for initializing the form field. |
Extends
Members
-
ELEMENT_FOCUS_CHANGED :string
-
Event constant for element focus change.
Type:
- string
-
ELEMENT_HELP_SHOWN :string
-
Event constant for element help shown.
Type:
- string
-
ELEMENT_ERROR_SHOWN :string
-
Event constant for element error shown.
Type:
- string
-
ELEMENT_VALUE_CHANGED :string
-
Event constant for value change.
Type:
- string
Methods
-
getWidget()
-
Gets the widget element used to capture the value from the user. Implementations should return the widget element that is used to capture the value from the user.
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The widget element.
- Type
- HTMLElement
-
-
getDescription()
-
Gets the element used to show the description of the field. Implementations should return the description element that is used to capture the description
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The description element.
- Type
- HTMLElement
-
-
getLabel()
-
Gets the element used to show the label of the field. Implementations should return the label element that is used to capture the label
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The label element.
- Type
- HTMLElement
-
-
getErrorDiv()
-
Gets the element used to show the error on the field. Implementations should return the error element that is used to capture the error
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The error element.
- Type
- HTMLElement
-
-
getTooltipDiv()
-
Gets the tooltip / short description div. Implementations should return the tooltip element that is used to capture the tooltip or short description
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The tooltip element.
- Type
- HTMLElement
-
-
getQuestionMarkDiv()
-
Gets the question mark div. Implementations should return the question mark element
Throws:
-
Throws an error if the method is not implemented.
- Type
- string
Returns:
- The question mark element.
- Type
- HTMLElement
-
-
getClass()
-
Gets the class of the form field.
Returns:
- The class of the form field.
- Type
- string
-
setModel(model)
-
Sets the model for the form field.
Parameters:
Name Type Description modelobject The model object.
- Overrides:
-
syncMarkupWithModel()
-
Synchronizes the markup with the model.
-
setFocus(id)
-
Sets the focus on the component's widget.
Parameters:
Name Type Description idstring The ID of the component's widget.
-
applyState(state)
-
Applies the full state of the field to the HTML. Generally done just after the model is bound to the field.
Parameters:
Name Type Description stateObject The state object.
-
initializeHelpContent(state)
-
Initializes the hint ('?') and long description.
Parameters:
Name Type Description stateObject The state object.
-
updateVisible(visible, state)
-
Updates the HTML based on the visible state.
Parameters:
Name Type Description visibleboolean The visible state.
stateObject The state object.
-
updateEnabled(enabled, state)
-
Updates the HTML state based on the enabled state of the field.
Parameters:
Name Type Description enabledboolean The enabled state.
stateObject The state object.
-
updateReadOnly(readOnly, state)
-
Updates the HTML state based on the read-only state of the field.
Parameters:
Name Type Description readOnlyboolean The read-only state.
stateObject The state object.
-
updateRequired(required, state)
-
Updates the HTML state based on the required state of the field.
Parameters:
Name Type Description requiredboolean The required state.
stateObject The state object.
-
updateValid(valid, state)
-
Updates the HTML state based on the valid state of the field.
Parameters:
Name Type Description validboolean The valid state.
stateObject The state object.
- Deprecated:
-
- Use the new method updateValidity() instead.
-
updateValidity(validity, state)
-
Updates the HTML state based on the validity state of the field.
Parameters:
Name Type Description validityObject The validity state.
stateObject The state object.
-
updateErrorMessage(errorMessage, state)
-
Updates the HTML state based on the error message state of the field.
Parameters:
Name Type Description errorMessagestring The error message.
stateObject The state object.
- Deprecated:
-
- Use the new method updateValidationMessage() instead.
-
updateValidationMessage(validationMessage, state)
-
Updates the HTML state based on the validation message state of the field.
Parameters:
Name Type Description validationMessagestring The validation message.
stateObject The state object.
-
updateValue(value)
-
Updates the HTML state based on the value state of the field.
Parameters:
Name Type Description valueany The value.
-
updateEmptyStatus()
-
Updates the HTML class based on the existence of a value in a field.
-
updateLabel(label)
-
Updates the HTML state based on the label state of the field.
Parameters:
Name Type Description labelObject The label.
-
updateActiveChild(activeChild)
-
Updates the active child of the form container.
Parameters:
Name Type Description activeChildObject The active child.
-
updateDescription(descriptionText)
-
Updates the HTML state based on the description state of the field.
Parameters:
Name Type Description descriptionTextstring The description.
-
setId(id)
-
Sets the ID of the form field.
Parameters:
Name Type Description idstring The ID to set for the form field.
- Inherited From:
- Overrides:
-
setParent(parentView)
-
Sets the parent view of the form field.
Parameters:
Name Type Description parentViewobject The parent view to set for the form field.
- Inherited From:
- Overrides:
-
setInstanceManager(instanceManager)
-
Sets the instance manager for the form field.
Parameters:
Name Type Description instanceManagerobject The instance manager to set for the form field.
- Inherited From:
- Overrides:
-
setActive()
-
Sets the form field as active.
- Inherited From:
- Overrides:
-
setInactive()
-
Sets the form field as inactive.
- Inherited From:
- Overrides:
-
isActive()
-
Checks if the form field is active.
- Inherited From:
- Overrides:
Returns:
True if the form field is active, false otherwise.
- Type
- boolean
-
getFormContainerPath()
-
Returns the form container path of the form field.
- Inherited From:
- Overrides:
Returns:
The form container path.
- Type
- string
-
getId()
-
Returns the ID of the form field.
- Inherited From:
- Overrides:
Returns:
The form field ID.
- Type
- string
-
toggle(property, dataAttribute, value)
-
Toggles the HTML element based on the property. If the property is false, then adds the data-attribute and CSS class.
Parameters:
Name Type Description propertyboolean The property to toggle.
dataAttributestring The data attribute to set or remove.
valuestring The value to set for the data attribute.
- Inherited From:
- Overrides:
-
toggleAttribute(element, property, dataAttribute, value)
-
Toggles the given element based on the property. If the property is false, then adds the data-attribute and CSS class.
Parameters:
Name Type Description elementHTMLElement The element to toggle.
propertyboolean The property to toggle.
dataAttributestring The data attribute to set or remove.
valuestring The value to set for the data attribute.
- Inherited From:
- Overrides:
-
getLayoutProperties()
-
Returns the 'afs:layout' properties. Empty object if no layout property is present.
- Inherited From:
- Overrides:
Returns:
The 'afs:layout' properties.
- Type
- object
-
getModel()
-
Returns the model of the form field.
- Inherited From:
- Overrides:
Returns:
The model of the form field.
- Type
- object
-
getInstanceManager()
-
Returns the instance manager of the form field.
- Inherited From:
- Overrides:
Returns:
The instance manager of the form field.
- Type
- object
-
subscribe()
-
Subscribes to model changes and updates the corresponding properties in the view.
- Inherited From:
- Overrides:
Throws:
-
Throws an error if the field does not subscribe to the model.
- Type
- string