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
.
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#constructor for a general description of the syntax of the settings object.
new sap.ui.layout.form.FormContainer(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Name | Type | Default Value | Description |
---|---|---|---|
_editable | boolean | false | Internal property for the |
expandable | boolean | false | Defines if the Note: The expander icon will only be shown if a |
expanded | boolean | true | Container is expanded. Note: This property only works if |
visible | boolean | true | If set to |
Default Aggregation: formElements
Name | Cardinality | Type | Description |
---|---|---|---|
_expandButton | 0..1 | sap.ui.core.Control | |
formElements (default) | 0..n | sap.ui.layout.form.FormElement |
The |
title | 0..1 | sap.ui.core.Title |
Title of the Note: If a Note: If the title is provided as a string, the title is rendered with a theme-dependent default level. As the |
toolbar | 0..1 | sap.ui.core.Toolbar |
Toolbar of the Note: If a |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / IDs that label this control (see WAI-ARIA attribute Note: This attribute is only rendered if the |
Method | Description |
---|---|
_setEditable |
Sets the editable state of the This must only be called from the Labels inside of a |
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
addFormElement |
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. |
sap.ui.layout.form.FormContainer.extend |
Creates a new subclass of class sap.ui.layout.form.FormContainer with name
|
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getExpandable |
Gets current value of property expandable. Defines if the Note: The expander icon will only be shown if a Default value is |
getExpanded |
Gets current value of property expanded. Container is expanded. Note: This property only works if Default value is |
getFormElements |
Gets content of aggregation formElements. The |
sap.ui.layout.form.FormContainer.getMetadata |
Returns a metadata object for class sap.ui.layout.form.FormContainer. |
getTitle |
Gets content of aggregation title. Title of the Note: If a Note: If the title is provided as a string, the title is rendered with a theme-dependent default level. As the |
getToolbar |
Gets content of aggregation toolbar. Toolbar of the Note: If a |
getVisible |
Gets current value of property visible. If set to Default value is |
indexOfFormElement |
Checks for the provided |
insertFormElement |
Inserts a formElement into the aggregation formElements. |
isVisible |
Determines if the For rendering by |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAllFormElements |
Removes all the controls from the aggregation formElements. Additionally, it unregisters them from the hosting UIArea. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
removeFormElement |
Removes a formElement from the aggregation formElements. |
setExpandable |
Sets a new value for property expandable. Defines if the Note: The expander icon will only be shown if a When called with a value of Default value is |
setExpanded |
Sets a new value for property expanded. Container is expanded. Note: This property only works if When called with a value of Default value is |
setTitle |
Sets the aggregated title. |
setToolbar |
Sets the aggregated toolbar. |
setVisible |
Sets a new value for property visible. If set to When called with a value of Default value is |
Sets the editable state of the FormContainer
.
This must only be called from the Form
.
Labels inside of a Form
must be invalidated if editable
changed on Form
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEditable | boolean |
Editable state of the |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
Adds some formElement to the aggregation formElements.
Param | Type | DefaultValue | Description |
---|---|---|---|
oFormElement | sap.ui.layout.form.FormElement |
The formElement to add; if empty, nothing is inserted |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
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
.
Gets current value of property expanded.
Container is expanded.
Note: This property only works if expandable
is set to true
.
Default value is true
.
Gets content of aggregation formElements.
The FormElements
contain the content (labels and fields) of the FormContainers
.
Returns a metadata object for class sap.ui.layout.form.FormContainer.
Gets content of aggregation title.
Title of the FormContainer
. Can either be a Title
element or a string. If a Title
element is used, the style of the title can be set.
Note: If a Toolbar
is used, the Title
is ignored.
Note: If the title is provided as a string, the title is rendered with a theme-dependent default level. As the Form
control cannot know the structure of the page, this might not fit the page structure. In this case provide the title using a Title
element and set its level to the needed value.
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. Use the right title level to meet the visual requirements. This might be theme-dependent.
Gets current value of property visible.
If set to false
, the FormContainer
is not rendered.
Default value is true
.
Checks for the provided sap.ui.layout.form.FormElement
in the aggregation formElements. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oFormElement | sap.ui.layout.form.FormElement |
The formElement whose index is looked for |
Inserts a formElement into the aggregation formElements.
Param | Type | DefaultValue | Description |
---|---|---|---|
oFormElement | sap.ui.layout.form.FormElement |
The formElement to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Determines if the FormContainer
is visible or not. Per default it just returns the value of the visible
property. But this might be overwritten by inherited elements.
For rendering by FormLayouts
this function has to be used instead of getVisible
.
Removes all the controls from the aggregation formElements.
Additionally, it unregisters them from the hosting UIArea.
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
Removes a formElement from the aggregation formElements.
Param | Type | DefaultValue | Description |
---|---|---|---|
vFormElement | int string sap.ui.layout.form.FormElement |
The formElement to remove or its index or id |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bExpandable | boolean | false |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bExpanded | boolean | true |
New value for property |
Sets the aggregated title.
Param | Type | DefaultValue | Description |
---|---|---|---|
vTitle | sap.ui.core.Title string |
The title to set |
Sets the aggregated toolbar.
Param | Type | DefaultValue | Description |
---|---|---|---|
oToolbar | sap.ui.core.Toolbar |
The toolbar to set |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bVisible | boolean | true |
New value for property |