A simple, large-sized text with explicit header / title semantics.
The Title
control is a simple, large-sized text containing additional semantic information for accessibility purposes.
As of version 1.52, you can truncate or wrap long titles if the screen is narrower than the full title by using the with the use of the wrapping
property.
As of version 1.60, you can hyphenate the label's text with the use of the wrappingType
property. For more information, see Text Controls Hyphenation.
As of version 1.87, you can set the content
aggregation to use sap.m.Link
or any control that implements sap.ui.core.ITitleContent
interface. This control will be rendered instead of the text placed in text
property. In this case the following properties of sap.m.Title
control are overridden: text
, textAlign
, textDirection
, or not used: wrapping
, wrappingType
. The title
association will be ignored too.
If the title
association is used, text
, level
and tooltip
properties will override the corresponding properties of the sap.m.Title
control.
Constructor for a new Title control.
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.m.Title(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 |
---|---|---|---|
level | sap.ui.core.TitleLevel | Auto | Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either an HTML h1-h6 element is used or when using level Note: this property will be overridden if there is title element associated and it has |
text | string | Defines the text that should be displayed as a title. Note: this property is not used if there is a control added to the |
|
textAlign | sap.ui.core.TextAlign | Initial | Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text. Note: this property will be overridden if there is a control added to the |
textDirection | sap.ui.core.TextDirection | Inherit | Options for the text direction are RTL and LTR. Alternatively, the control can inherit the text direction from its parent container. Note: this property will be overridden if there is a control added to the |
titleStyle | sap.ui.core.TitleLevel | Auto | Defines the style of the title. When using the |
width | sap.ui.core.CSSSize | Defines the width of the title. Visibility: public |
|
wrapping | boolean | false | Enables text wrapping. Note: Wrapping must only be activated if the surrounding container allows flexible heights. Note: this property will be ignored if there is a control added to the |
wrappingType | sap.m.WrappingType | Normal | Defines the type of text wrapping to be used (hyphenated or normal). Note: This property takes effect only when the |
Default Aggregation: content
Name | Cardinality | Type | Description |
---|---|---|---|
content (default) | 0..1 | sap.ui.core.ITitleContent |
Holds a control that implements Note: if a control is placed in this aggregation, the following properties of |
Name | Cardinality | Type | Description |
---|---|---|---|
title | 0..1 | sap.ui.core.Title |
Defines a relationship to a generic title description. Note: if a control is placed in |
Method | Description |
---|---|
destroyContent |
Destroys the content in the aggregation content. |
sap.m.Title.extend |
Creates a new subclass of class sap.m.Title with name
|
getAccessibilityInfo |
Gets the accessibility information for the
|
getContent |
Gets content of aggregation content. Holds a control that implements Note: if a control is placed in this aggregation, the following properties of |
getLevel |
Gets current value of property level. Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either an HTML h1-h6 element is used or when using level Note: this property will be overridden if there is title element associated and it has Default value is |
sap.m.Title.getMetadata |
Returns a metadata object for class sap.m.Title. |
getText |
Gets current value of property text. Defines the text that should be displayed as a title. Note: this property is not used if there is a control added to the |
getTextAlign |
Gets current value of property textAlign. Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text. Note: this property will be overridden if there is a control added to the Default value is |
getTextDirection |
Gets current value of property textDirection. Options for the text direction are RTL and LTR. Alternatively, the control can inherit the text direction from its parent container. Note: this property will be overridden if there is a control added to the Default value is |
getTitle |
ID of the element which is the current target of the association title, or |
getTitleStyle |
Gets current value of property titleStyle. Defines the style of the title. When using the Default value is |
getWidth |
Gets current value of property width. Defines the width of the title. |
getWrapping |
Gets current value of property wrapping. Enables text wrapping. Note: Wrapping must only be activated if the surrounding container allows flexible heights. Note: this property will be ignored if there is a control added to the Default value is |
getWrappingType |
Gets current value of property wrappingType. Defines the type of text wrapping to be used (hyphenated or normal). Note: This property takes effect only when the Default value is |
setContent |
Sets the aggregated content. |
setLevel |
Sets a new value for property level. Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either an HTML h1-h6 element is used or when using level Note: this property will be overridden if there is title element associated and it has When called with a value of Default value is |
setText |
Sets a new value for property text. Defines the text that should be displayed as a title. Note: this property is not used if there is a control added to the When called with a value of |
setTextAlign |
Sets a new value for property textAlign. Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text. Note: this property will be overridden if there is a control added to the When called with a value of Default value is |
setTextDirection |
Sets a new value for property textDirection. Options for the text direction are RTL and LTR. Alternatively, the control can inherit the text direction from its parent container. Note: this property will be overridden if there is a control added to the When called with a value of Default value is |
setTitle |
Sets the title for a |
setTitleStyle |
Sets a new value for property titleStyle. Defines the style of the title. When using the When called with a value of Default value is |
setWidth |
Sets a new value for property width. Defines the width of the title. When called with a value of |
setWrapping |
Sets a new value for property wrapping. Enables text wrapping. Note: Wrapping must only be activated if the surrounding container allows flexible heights. Note: this property will be ignored if there is a control added to the When called with a value of Default value is |
setWrappingType |
Sets a new value for property wrappingType. Defines the type of text wrapping to be used (hyphenated or normal). Note: This property takes effect only when the When called with a value of Default value is |
Creates a new subclass of class sap.m.Title 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 |
Gets the accessibility information for the sap.m.Title
control.
References:
Gets content of aggregation content.
Holds a control that implements sap.ui.core.ITitleContent
and renders this control instead of simple text
Note: if a control is placed in this aggregation, the following properties of sap.m.Title
will be overridden - text
, textAlign
, textDirection
; the following will be ignored - wrapping
, wrappingType
. The title
association will be ignored too.
Gets current value of property level.
Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either an HTML h1-h6 element is used or when using level Auto
no explicit level information is written (HTML5 header element). This property does not influence the style of the control. Use the property titleStyle
for this purpose instead.
Note: this property will be overridden if there is title element associated and it has level
property set.
Default value is Auto
.
Gets current value of property text.
Defines the text that should be displayed as a title.
Note: this property is not used if there is a control added to the content
aggregation Note: this property will be overridden if there is title element associated and it has text
property set.
Gets current value of property textAlign.
Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text.
Note: this property will be overridden if there is a control added to the content
aggregation
Default value is Initial
.
Gets current value of property textDirection.
Options for the text direction are RTL and LTR. Alternatively, the control can inherit the text direction from its parent container.
Note: this property will be overridden if there is a control added to the content
aggregation
Default value is Inherit
.
Gets current value of property titleStyle.
Defines the style of the title. When using the Auto
styling, the appearance of the title depends on the current position of the title (e.g. inside a Toolbar
). This default behavior can be overridden by setting a different style explicitly. The actual appearance of the title and the different styles always depends on the theme being used.
Default value is Auto
.
Gets current value of property wrapping.
Enables text wrapping.
Note: Wrapping must only be activated if the surrounding container allows flexible heights. Note: this property will be ignored if there is a control added to the content
aggregation
Default value is false
.
Gets current value of property wrappingType.
Defines the type of text wrapping to be used (hyphenated or normal).
Note: This property takes effect only when the wrapping
property is set to true
. Note: this property will be ignored if there is a control added to the content
aggregation
Default value is Normal
.
Sets the aggregated content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oContent | sap.ui.core.ITitleContent |
The content to set |
Sets a new value for property level.
Defines the semantic level of the title. This information is e.g. used by assistive technologies like screenreaders to create a hierarchical site map for faster navigation. Depending on this setting either an HTML h1-h6 element is used or when using level Auto
no explicit level information is written (HTML5 header element). This property does not influence the style of the control. Use the property titleStyle
for this purpose instead.
Note: this property will be overridden if there is title element associated and it has level
property set.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Auto
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sLevel | sap.ui.core.TitleLevel | Auto |
New value for property |
Sets a new value for property text.
Defines the text that should be displayed as a title.
Note: this property is not used if there is a control added to the content
aggregation Note: this property will be overridden if there is title element associated and it has text
property set.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sText | string |
New value for property |
Sets a new value for property textAlign.
Defines the alignment of the text within the title. Note: This property only has an effect if the overall width of the title control is larger than the displayed text.
Note: this property will be overridden if there is a control added to the content
aggregation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Initial
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextAlign | sap.ui.core.TextAlign | Initial |
New value for property |
Sets a new value for property textDirection.
Options for the text direction are RTL and LTR. Alternatively, the control can inherit the text direction from its parent container.
Note: this property will be overridden if there is a control added to the content
aggregation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTextDirection | sap.ui.core.TextDirection | Inherit |
New value for property |
Sets the title for a sap.m.Title
or sap.ui.core.Title
Param | Type | DefaultValue | Description |
---|---|---|---|
vTitle | sap.m.Title sap.ui.core.Title |
Given variant of the a title which can be |
Sets a new value for property titleStyle.
Defines the style of the title. When using the Auto
styling, the appearance of the title depends on the current position of the title (e.g. inside a Toolbar
). This default behavior can be overridden by setting a different style explicitly. The actual appearance of the title and the different styles always depends on the theme being used.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Auto
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTitleStyle | sap.ui.core.TitleLevel | Auto |
New value for property |
Sets a new value for property width.
Defines the width of the title.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize |
New value for property |
Sets a new value for property wrapping.
Enables text wrapping.
Note: Wrapping must only be activated if the surrounding container allows flexible heights. Note: this property will be ignored if there is a control added to the content
aggregation
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 |
---|---|---|---|
bWrapping | boolean | false |
New value for property |
Sets a new value for property wrappingType.
Defines the type of text wrapping to be used (hyphenated or normal).
Note: This property takes effect only when the wrapping
property is set to true
. Note: this property will be ignored if there is a control added to the content
aggregation
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Normal
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWrappingType | sap.m.WrappingType | Normal |
New value for property |