new FormTabs(params, ns, is, selectors)
Create a FormTabs instance.
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
params |
object | The parameters object. Properties
|
||||||
ns |
string | The namespace. |
||||||
is |
string | The IS. |
||||||
selectors |
object | The selectors object. |
Extends
Members
-
keyCodes :object
-
Keycodes for various keyboard keys.
Type:
- object
-
ELEMENT_FOCUS_CHANGED :string
-
Event constant for element focus change.
Type:
- string
- Inherited From:
- Overrides:
-
ELEMENT_HELP_SHOWN :string
-
Event constant for element help shown.
Type:
- string
- Inherited From:
- Overrides:
-
ELEMENT_ERROR_SHOWN :string
-
Event constant for element error shown.
Type:
- string
- Inherited From:
- Overrides:
-
ELEMENT_VALUE_CHANGED :string
-
Event constant for value change.
Type:
- string
- Inherited From:
- Overrides:
Methods
-
(tabId)
-
Retrieves the index of a tab element by its ID.
Parameters:
Name Type Description tabIdstring The ID of the tab element.
Returns:
The index of the tab element, or -1 if not found.
- Type
- number
-
focusWithoutScroll(element)
-
Focuses the element and prevents scrolling the element into view.
Parameters:
Name Type Description elementHTMLElement Element to focus.
-
getActiveTabId(tabs)
-
Returns the id of the active tab, if no tab is active returns 0th element id
Parameters:
Name Type Description tabsArray Tab elements
Returns:
Id of the active tab, 0th element id if none is active
- Type
- Number
-
syncMarkupWithModel()
-
Synchronizes the markup with the component model. Calls the syncMarkupWithModel method of the superclass. Calls #syncTabLabels and #syncTabPanels methods.
-
addRepeatableMarkup(instanceManager, addedModel, htmlElement)
-
Adds unique HTML for an added instance corresponding to the requirements of different types of repeatable parents.
Parameters:
Name Type Description instanceManagerObject The instance manager of the repeated component.
addedModelObject The added model of the repeated component.
htmlElementHTMLElement The HTML element of the repeated component.
Returns:
The enclosed element containing the added instance HTML.
- Type
- HTMLElement
-
instantiateInstanceManager()
-
Instantiates the InstanceManager for the FormPanel.
- Inherited From:
- Overrides:
Returns:
The newly instantiated InstanceManager.
- Type
- InstanceManager
-
setModel(model)
-
Sets the model for the FormPanel.
Parameters:
Name Type Description modelObject The model to be set for the FormPanel.
- Inherited From:
- Overrides:
-
setFocus(id)
-
Sets the focus to a child element within the FormPanel.
Parameters:
Name Type Description idstring The ID of the child element to set focus to.
- Inherited From:
- Overrides:
-
focusToFirstVisibleField(id)
-
Sets the focus to first field while navigating in navigable layouts.
Parameters:
Name Type Description idstring The ID of the field to set focus to.
- Inherited From:
- Overrides:
-
getCountOfAllChildrenInModel()
-
Gets the count of all children in the model.
- Inherited From:
- Overrides:
Returns:
The count of all children in the model.
- Type
- number
-
getChild(id)
-
Gets a child view by its ID.
Parameters:
Name Type Description idstring The ID of the child view to retrieve.
- Inherited From:
- Overrides:
Returns:
The child view with the specified ID.
- Type
- Object
-
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 to be applied.
- Inherited From:
- Overrides:
-
getIndexToInsert(closestNonRepeatableFieldId, closestRepeatableFieldInstanceManagerIds)
-
Gets the index at which to insert a new field.
Parameters:
- Inherited From:
- Overrides:
Returns:
The index at which to insert the new field.
- Type
- number
-
getRepeatableRootElement(childView)
-
Gets the repeatable root element of a child view.
Parameters:
Name Type Description childViewObject The child view.
- Inherited From:
- Overrides:
Returns:
The repeatable root element.
- Type
- HTMLElement
-
findFirstVisibleChild(children)
-
Finds the first visible child element from the given children.
Parameters:
Name Type Description childrenArray:.<HTMLElement:> The children elements to search.
- Inherited From:
- Overrides:
Returns:
The first visible child element, or null if none found.
- Type
- HTMLElement
-
updateEmptyStatus()
-
Updates the HTML class based on the existence of a value in a field. For the layout components, there's no need to do this, so override the updateEmptyStatus method.
- Inherited From:
- Overrides:
-
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.
- Inherited From:
- Overrides:
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
- Inherited From:
- Overrides:
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
- Inherited From:
- Overrides:
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
- Inherited From:
- Overrides:
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
- Inherited From:
- Overrides:
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
- Inherited From:
- Overrides:
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.
- Inherited From:
- Overrides:
Returns:
- The class of the form field.
- Type
- string
-
initializeHelpContent(state)
-
Initializes the hint ('?') and long description.
Parameters:
Name Type Description stateObject The state object.
- Inherited From:
- Overrides:
-
updateVisible(visible, state)
-
Updates the HTML based on the visible state.
Parameters:
Name Type Description visibleboolean The visible state.
stateObject The state object.
- Inherited From:
- Overrides:
-
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.
- Inherited From:
- Overrides:
-
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.
- Inherited From:
- Overrides:
-
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.
- Inherited From:
- Overrides:
- 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.
- Inherited From:
- Overrides:
-
updateValue(value)
-
Updates the HTML state based on the value state of the field.
Parameters:
Name Type Description valueany The value.
- Inherited From:
- Overrides:
-
updateLabel(label)
-
Updates the HTML state based on the label state of the field.
Parameters:
Name Type Description labelObject The label.
- Inherited From:
- Overrides:
-
updateActiveChild(activeChild)
-
Updates the active child of the form container.
Parameters:
Name Type Description activeChildObject The active child.
- Inherited From:
- Overrides:
-
updateDescription(descriptionText)
-
Updates the HTML state based on the description state of the field.
Parameters:
Name Type Description descriptionTextstring The description.
- Inherited From:
- Overrides:
-
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
-
addChild(childView)
-
Adds a child view.
Parameters:
Name Type Description childViewObject The child view to be added.
- Inherited From:
- Overrides:
-
handleChildAddition(childView)
-
Handles the addition of a child view.
Parameters:
Name Type Description childViewObject The child view being added.
- Inherited From:
- Overrides:
-
handleChildRemoval(removedInstanceView)
-
Handles the removal of a child view.
Parameters:
Name Type Description removedInstanceViewObject The removed child view.
- Inherited From:
- Overrides:
-
getChildViewByIndex(index)
-
Gets the child view at the specified index.
Parameters:
Name Type Description indexnumber The index of the child view.
- Inherited From:
- Overrides:
Returns:
The child view at the specified index.
- Type
- Object
-
updateChildVisibility(visible, state)
-
Updates the visibility of a child element based on the provided state.
Parameters:
Name Type Description visibleboolean The visibility state of the child element.
stateObject The state of the child element.
- Inherited From:
- Overrides: