known direct subclasses: Form
Form control. A Form
is structured into FormContainers
. Each FormContainer
consists of FormElements
. The FormElements
consists of a label and the form fields. A Form
doesn't render its content by itself. The rendering is done by the assigned FormLayout
. This is so that the rendering can be adopted to new UI requirements without changing the Form itself.
For the content of a Form
, VariantLayoutData
are supported to allow simple switching of the FormLayout
. LayoutData
on the content can be used to overwrite the default layout of the code>Form.
Note: Do not put any layout controls into the FormElements
. This could destroy the visual layout, keyboard support and screen-reader support.
Since: 1.16.0.
Method Summary
sap.ui.layout.form.Form.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.layout.form.Form with name sClassName
and enriches it with the information contained in oClassInfo
. addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy
. addFormContainer(oFormContainer)Adds some formContainer to the aggregation formContainers
. getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
. getLayout()Gets content of aggregation layout
. getTitle()Gets content of aggregation title
. getWidth()Gets current value of property width
. indexOfFormContainer(oFormContainer)Checks for the provided sap.ui.layout.form.FormContainer
in the aggregation formContainers
. insertFormContainer(oFormContainer, iIndex)Inserts a formContainer into the aggregation formContainers
. removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy
. removeFormContainer(vFormContainer)Removes a formContainer from the aggregation formContainers
. setEditable(bEditable)Sets a new value for property editable
. setLayout(oLayout)Sets the aggregated layout
. setTitle(vTitle)Sets the aggregated title
. setWidth(sWidth)Sets a new value for property width
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
init,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.layout.form.Form(sId?, mSettings?)
Constructor for a new sap.ui.layout.form.Form.
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
- formContainers : sap.ui.layout.form.FormContainer[] (default)
- title : sap.ui.core.Title|string
- toolbar : sap.ui.core.Toolbar
- layout : sap.ui.layout.form.FormLayout
In addition, all settings applicable to the base type sap.ui.core.Control 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.Form.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.layout.form.Form 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.Control.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 |
Returns a metadata object for class sap.ui.layout.form.Form.
Returns:
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.28.0
Returns:
Adds some formContainer to the aggregation formContainers
.
Parameters:
Returns:
Destroys all the formContainers in the aggregation formContainers
.
Returns:
Destroys the layout in the aggregation layout
.
Returns:
Destroys the title in the aggregation title
.
Returns:
Destroys the toolbar in the aggregation toolbar
.
- Since:
- 1.36.0
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
- Since:
- 1.28.0
Returns:
getEditable(): boolean
Gets current value of property
editable
.
Applies a device and theme specific line-height to the form rows if the form has editable content. If set, all (not only the editable) rows of the form will get the line height of editable fields. The accessibility aria-readonly attribute is set according to this property. Note: The setting of the property has no influence on the editable functionality of the form's content.
Default value is false
.
- Since:
- 1.20.0
Returns:
{boolean} | Value of property editable |
Gets content of aggregation
formContainers
.
Containers with the content of the form. A FormContainer
represents a group inside the Form
.
Returns:
Gets content of aggregation
layout
.
Layout of the Form
. The assigned Layout
renders the Form
. We suggest using the ResponsiveGridLayout
for rendering a Form
, as its responsiveness allows the available space to be used in the best way possible.
Returns:
Gets content of aggregation
title
.
Title of the Form
. Can either be a Title
object, or a string. If a Title
object it used, the style of the title can be set.
Note: If a Toolbar
is used, the Title
is ignored.
Returns:
Gets content of aggregation
toolbar
.
Toolbar of the Form
.
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:
Gets current value of property
width
.
Width of the Form
.
Returns:
indexOfFormContainer(oFormContainer): int
Checks for the provided sap.ui.layout.form.FormContainer
in the aggregation formContainers
. and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a formContainer into the aggregation formContainers
.
Parameters:
{sap.ui.layout.form.FormContainer} | oFormContainer | the formContainer to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the formContainer should be inserted at; for a negative value of iIndex , the formContainer is inserted at position 0; for a value greater than the current size of the aggregation, the formContainer is inserted at the last position |
Returns:
Removes all the controls in the association named ariaLabelledBy
.
- Since:
- 1.28.0
Returns:
Removes all the controls from the aggregation
formContainers
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
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.28.0
Returns:
Removes a formContainer from the aggregation formContainers
.
Parameters:
Returns:
Sets a new value for property
editable
.
Applies a device and theme specific line-height to the form rows if the form has editable content. If set, all (not only the editable) rows of the form will get the line height of editable fields. The accessibility aria-readonly attribute is set according to this property. Note: The setting of the property has no influence on the editable functionality of the form's content.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Parameters:
{boolean} | bEditable | New value for property editable |
- Since:
- 1.20.0
Returns:
Sets the aggregated layout
.
Parameters:
Returns:
Sets the aggregated title
.
Parameters:
Returns:
Sets the aggregated toolbar
.
Parameters:
- Since:
- 1.36.0
Returns:
Sets a new value for property
width
.
Width of the Form
.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
Returns: