class sap.ui.commons.FormattedTextView

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

The FormattedTextView control allows the usage of a limited set of HTML tags for display.


Constructor

Constructor for a new FormattedTextView.

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.commons.FormattedTextView(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
accessibleRole sap.ui.core.AccessibleRole Document

The ARIA role for the control.

Visibility: public
htmlText string empty string

Determines text with placeholders.

Visibility: public

Aggregations

Default Aggregation:

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

Array of controls that should be replaced within htmlText.


Methods Overview

Method Description
addControl

Adds some control to the aggregation controls.

destroyControls

Destroys all the controls in the aggregation controls.

sap.ui.commons.FormattedTextView.extend

Creates a new subclass of class sap.ui.commons.FormattedTextView 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.

getAccessibleRole

Gets current value of property accessibleRole.

The ARIA role for the control.

Default value is Document.

getControls

Gets content of aggregation controls.

Array of controls that should be replaced within htmlText.

getHtmlText

Gets current value of property htmlText.

Determines text with placeholders.

Default value is empty string.

sap.ui.commons.FormattedTextView.getMetadata

Returns a metadata object for class sap.ui.commons.FormattedTextView.

hasControls

Indicates whether the FormattedTextView contains other controls.

indexOfControl

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

insertControl

Inserts a control into the aggregation controls.

removeAllControls

Removes all the controls from the aggregation controls.

Additionally, it unregisters them from the hosting UIArea.

removeControl

Removes a control from the aggregation controls.

setAccessibleRole

Sets a new value for property accessibleRole.

The ARIA role for the control.

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

Default value is Document.

setContent

Sets text with placeholders and given array of controls.

setHtmlText

Sets the HTML text to be displayed.

addControl

Adds some control to the aggregation controls.

Param Type DefaultValue Description
oControl sap.ui.core.Control

The control to add; if empty, nothing is inserted

destroyControls

Destroys all the controls in the aggregation controls.

sap.ui.commons.FormattedTextView.extend

Creates a new subclass of class sap.ui.commons.FormattedTextView 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.

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

getAccessibleRole

Gets current value of property accessibleRole.

The ARIA role for the control.

Default value is Document.

getControls

Gets content of aggregation controls.

Array of controls that should be replaced within htmlText.

getHtmlText

Gets current value of property htmlText.

Determines text with placeholders.

Default value is empty string.

sap.ui.commons.FormattedTextView.getMetadata

Returns a metadata object for class sap.ui.commons.FormattedTextView.

hasControls

Indicates whether the FormattedTextView contains other controls.

indexOfControl

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

Param Type DefaultValue Description
oControl sap.ui.core.Control

The control whose index is looked for

insertControl

Inserts a control into the aggregation controls.

Param Type DefaultValue Description
oControl sap.ui.core.Control

The control to insert; if empty, nothing is inserted

iIndex int

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

removeAllControls

Removes all the controls from the aggregation controls.

Additionally, it unregisters them from the hosting UIArea.

removeControl

Removes a control from the aggregation controls.

Param Type DefaultValue Description
vControl int string sap.ui.core.Control

The control to remove or its index or id

setAccessibleRole

Sets a new value for property accessibleRole.

The ARIA role for the control.

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

Default value is Document.

Param Type DefaultValue Description
sAccessibleRole sap.ui.core.AccessibleRole Document

New value for property accessibleRole

setContent

Sets text with placeholders and given array of controls.

Param Type DefaultValue Description
sHtmlText string

Contains the corresponding HTML text

aControls sap.ui.commons.FormattedTextViewControl

Array of controls that should be used within given HTML text

setHtmlText

Sets the HTML text to be displayed.

Param Type DefaultValue Description
sText string

HTML text as a string