class sap.ui.layout.form.SemanticFormElement

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/layout/form/SemanticFormElement
Application Component: CA-UI5-CTR

A SemanticFormElement element is a special FormElement that contains semantically connected fields. These field controls are divided by delimiter controls. In display mode, they are rendered as one condensed string, in edit mode as separate fields.

Note: Please use the ColumnLayout as layout of the Form. For other layouts, the field arrangement might not be suitable in every case.


Constructor

Constructor for a new sap.ui.layout.form.SemanticFormElement.

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.SemanticFormElement(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


Properties

Name Type Default Value Description
delimiter string /

Delimiter symbol to separate the fields.

Visibility: public

Borrowed Properties

Name Type Default Value Description
visible boolean true

If set to false, the FormElement is not rendered.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_delimiters 0..n sap.ui.core.Control
_displayField 0..1 sap.ui.core.Control
fieldLabels 0..n sap.ui.core.Label

Labels of the individual fields. Can either be a Label control or a string.

If a Label control is used, the properties of the Label can be set.

These labels are not rendered directly. If the Label property of SemanticFormElement is not set, the texts of the labels are concatenated into the Label property of SemanticFormElement. Otherwise the set Label is shown.

Note: If this aggregation is used, a label is assigned to every single field of SemanticFormElement. The order of the labels and the fields must be the same.

Borrowed Aggregations

Name Cardinality Type Description
fields 0..n sap.ui.core.Control

Form controls that belong together to be displayed in one row of a Form.

Warning: Do not put any layout or other container controls in here. This could damage the visual layout, keyboard support and screen-reader support. Only form controls are allowed. Views are also not supported. Allowed controls implement the interface sap.ui.core.IFormContent.

label 0..1 sap.ui.core.Label

Label of the fields. Can either be a Label control or a string. If a Label control is used, the properties of the Label can be set. If no assignment between Label and the fields is set via (labelFor property of the Label), it will be done automatically by the FormElement. In this case the Label is assigned to the fields of the FormElement.


Methods Overview

Method Description
addFieldLabel

Adds some fieldLabel to the aggregation fieldLabels.

destroyFieldLabels

Destroys all the fieldLabels in the aggregation fieldLabels.

sap.ui.layout.form.SemanticFormElement.extend

Creates a new subclass of class sap.ui.layout.form.SemanticFormElement 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.layout.form.FormElement.extend.

getDelimiter

Gets current value of property delimiter.

Delimiter symbol to separate the fields.

Default value is "/".

getFieldLabels

Gets content of aggregation fieldLabels.

Labels of the individual fields. Can either be a Label control or a string.

If a Label control is used, the properties of the Label can be set.

These labels are not rendered directly. If the Label property of SemanticFormElement is not set, the texts of the labels are concatenated into the Label property of SemanticFormElement. Otherwise the set Label is shown.

Note: If this aggregation is used, a label is assigned to every single field of SemanticFormElement. The order of the labels and the fields must be the same.

getFieldsForRendering

Determines which fields are rendered.

In edit mode, the field controls are rendered separated by the delimiters. In display mode, one text is rendered.

sap.ui.layout.form.SemanticFormElement.getMetadata

Returns a metadata object for class sap.ui.layout.form.SemanticFormElement.

indexOfFieldLabel

Checks for the provided sap.ui.core.Label in the aggregation fieldLabels. and returns its index if found or -1 otherwise.

insertFieldLabel

Inserts a fieldLabel into the aggregation fieldLabels.

removeAllFieldLabels

Removes all the controls from the aggregation fieldLabels.

Additionally, it unregisters them from the hosting UIArea.

removeFieldLabel

Removes a fieldLabel from the aggregation fieldLabels.

setDelimiter

Sets a new value for property delimiter.

Delimiter symbol to separate the fields.

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

Default value is "/".

addFieldLabel

Adds some fieldLabel to the aggregation fieldLabels.

Param Type DefaultValue Description
oFieldLabel sap.ui.core.Label

The fieldLabel to add; if empty, nothing is inserted

destroyFieldLabels

Destroys all the fieldLabels in the aggregation fieldLabels.

sap.ui.layout.form.SemanticFormElement.extend

Creates a new subclass of class sap.ui.layout.form.SemanticFormElement 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.layout.form.FormElement.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

getDelimiter

Gets current value of property delimiter.

Delimiter symbol to separate the fields.

Default value is "/".

getFieldLabels

Gets content of aggregation fieldLabels.

Labels of the individual fields. Can either be a Label control or a string.

If a Label control is used, the properties of the Label can be set.

These labels are not rendered directly. If the Label property of SemanticFormElement is not set, the texts of the labels are concatenated into the Label property of SemanticFormElement. Otherwise the set Label is shown.

Note: If this aggregation is used, a label is assigned to every single field of SemanticFormElement. The order of the labels and the fields must be the same.

getFieldsForRendering

Determines which fields are rendered.

In edit mode, the field controls are rendered separated by the delimiters. In display mode, one text is rendered.

sap.ui.layout.form.SemanticFormElement.getMetadata

Returns a metadata object for class sap.ui.layout.form.SemanticFormElement.

indexOfFieldLabel

Checks for the provided sap.ui.core.Label in the aggregation fieldLabels. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oFieldLabel sap.ui.core.Label

The fieldLabel whose index is looked for

insertFieldLabel

Inserts a fieldLabel into the aggregation fieldLabels.

Param Type DefaultValue Description
oFieldLabel sap.ui.core.Label

The fieldLabel to insert; if empty, nothing is inserted

iIndex int

The 0-based index the fieldLabel should be inserted at; for a negative value of iIndex, the fieldLabel is inserted at position 0; for a value greater than the current size of the aggregation, the fieldLabel is inserted at the last position

removeAllFieldLabels

Removes all the controls from the aggregation fieldLabels.

Additionally, it unregisters them from the hosting UIArea.

removeFieldLabel

Removes a fieldLabel from the aggregation fieldLabels.

Param Type DefaultValue Description
vFieldLabel int string sap.ui.core.Label

The fieldLabel to remove or its index or id

setDelimiter

Sets a new value for property delimiter.

Delimiter symbol to separate the fields.

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

Default value is "/".

Param Type DefaultValue Description
sDelimiter string "/"

New value for property delimiter