Class sap.ui.layout.form.FormContainerModule: sap/ui/layout/form/FormContainer

extends Element
known direct subclasses: FormContainer

A FormContainer represents a group inside a Form. It consists of FormElements. The rendering of the FormContainer is done by the FormLayout assigned to the Form.


Since: 1.16.0.
Constructor Summary
new sap.ui.layout.form.FormContainer(sId?, mSettings?)Constructor for a new sap.ui.layout.form.FormContainer.
Method Summary
sap.ui.layout.form.FormContainer.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.layout.form.FormContainer with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.layout.form.FormContainer.getMetadata()Returns a metadata object for class sap.ui.layout.form.FormContainer.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
addFormElement(oFormElement)Adds some formElement to the aggregation formElements.
destroyFormElements()Destroys all the formElements in the aggregation formElements.
destroyTitle()Destroys the title in the aggregation title.
destroyToolbar()Destroys the toolbar in the aggregation toolbar.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getExpandable()Gets current value of property expandable.
getExpanded()Gets current value of property expanded.
getFormElements()Gets content of aggregation formElements.
getTitle()Gets content of aggregation title.
getToolbar()Gets content of aggregation toolbar.
getVisible()Gets current value of property visible.
indexOfFormElement(oFormElement)Checks for the provided sap.ui.layout.form.FormElement in the aggregation formElements.
insertFormElement(oFormElement, iIndex)Inserts a formElement into the aggregation formElements.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAllFormElements()Removes all the controls from the aggregation formElements.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
removeFormElement(vFormElement)Removes a formElement from the aggregation formElements.
setExpandable(bExpandable)Sets a new value for property expandable.
setExpanded(bExpanded)Sets a new value for property expanded.
setTitle(vTitle)Sets the aggregated title.
setToolbar(oToolbar)Sets the aggregated toolbar.
setVisible(bVisible)Sets a new value for property visible.
Constructor Detail
new sap.ui.layout.form.FormContainer(sId?, mSettings?)
Constructor for a new sap.ui.layout.form.FormContainer.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Aggregations

In addition, all settings applicable to the base type sap.ui.core.Element can be used as well.

Parameters:
{string}sId? Id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Method Detail
sap.ui.layout.form.FormContainer.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.layout.form.FormContainer with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Element.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.layout.form.FormContainer.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.layout.form.FormContainer.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.ui.layout.form.FormContainer
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Since:
1.36.0
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
addFormElement(oFormElement): sap.ui.layout.form.FormContainer
Adds some formElement to the aggregation formElements.
Parameters:
{sap.ui.layout.form.FormElement}oFormElement the formElement to add; if empty, nothing is inserted
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
destroyFormElements(): sap.ui.layout.form.FormContainer
Destroys all the formElements in the aggregation formElements.
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
Destroys the title in the aggregation title.
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
Destroys the toolbar in the aggregation toolbar.
Since:
1.36.0
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Since:
1.36.0
Returns:
{sap.ui.core.Control[]}
getExpandable(): boolean
Gets current value of property expandable.

Defines if the FormContainer is expandable. Note: The expander icon will only be shown if a title is set for the FormContainer.

Default value is false.

Returns:
{boolean} Value of property expandable
getExpanded(): boolean
Gets current value of property expanded.

Container is expanded. Note: This property only works if expandable is set to true.

Default value is true.

Returns:
{boolean} Value of property expanded
getFormElements(): sap.ui.layout.form.FormElement[]
Gets content of aggregation formElements.

The FormElements contain the content (labels and fields) of the FormContainers.

Returns:
{sap.ui.layout.form.FormElement[]}
getTitle(): sap.ui.core.Title|string
Gets content of aggregation title.

Title of the FormContainer. Can either be a Title object, or a string. If a Title object is used, the style of the title can be set.

Note: If a Toolbar is used, the Title is ignored.

Returns:
{sap.ui.core.Title|string}
getToolbar(): sap.ui.core.Toolbar
Gets content of aggregation toolbar.

Toolbar of the FormContainer.

Note: If a Toolbar is used, the Title is ignored. If a title is needed inside the Toolbar it must be added at content to the Toolbar. In this case add the Title to the ariaLabelledBy association.

Since:
1.36.0
Returns:
{sap.ui.core.Toolbar}
getVisible(): boolean
Gets current value of property visible.

If set to false, the FormContainer is not rendered.

Default value is true.

Returns:
{boolean} Value of property visible
indexOfFormElement(oFormElement): int
Checks for the provided sap.ui.layout.form.FormElement in the aggregation formElements. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.layout.form.FormElement}oFormElement The formElement whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertFormElement(oFormElement, iIndex): sap.ui.layout.form.FormContainer
Inserts a formElement into the aggregation formElements.
Parameters:
{sap.ui.layout.form.FormElement}oFormElement the formElement to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the formElement should be inserted at; for a negative value of iIndex, the formElement is inserted at position 0; for a value greater than the current size of the aggregation, the formElement is inserted at the last position
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Since:
1.36.0
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAllFormElements(): sap.ui.layout.form.FormElement[]
Removes all the controls from the aggregation formElements.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.layout.form.FormElement[]} An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Since:
1.36.0
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
removeFormElement(vFormElement): sap.ui.layout.form.FormElement
Removes a formElement from the aggregation formElements.
Parameters:
{int|string|sap.ui.layout.form.FormElement}vFormElement The formElementto remove or its index or id
Returns:
{sap.ui.layout.form.FormElement} The removed formElement or null
setExpandable(bExpandable): sap.ui.layout.form.FormContainer
Sets a new value for property expandable.

Defines if the FormContainer is expandable. Note: The expander icon will only be shown if a title is set for the FormContainer.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

Parameters:
{boolean}bExpandable New value for property expandable
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
setExpanded(bExpanded): sap.ui.layout.form.FormContainer
Sets a new value for property expanded.

Container is expanded. Note: This property only works if expandable is set to true.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bExpanded New value for property expanded
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
Sets the aggregated title.
Parameters:
{sap.ui.core.Title|string}vTitle The title to set
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
setToolbar(oToolbar): sap.ui.layout.form.FormContainer
Sets the aggregated toolbar.
Parameters:
{sap.ui.core.Toolbar}oToolbar The toolbar to set
Since:
1.36.0
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining
setVisible(bVisible): sap.ui.layout.form.FormContainer
Sets a new value for property visible.

If set to false, the FormContainer is not rendered.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bVisible New value for property visible
Returns:
{sap.ui.layout.form.FormContainer} Reference to this in order to allow method chaining