Class sap.m.LinkModule: sap/m/Link
A hyperlink control which can be used to trigger actions or to navigate to other applications or web pages.
Since: 1.12.
sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the press
event of this sap.m.Link
.fnFunction
from the press
event of this sap.m.Link
.ariaDescribedBy
.ariaLabelledBy
.ariaDescribedBy
.ariaLabelledBy
. 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
- text : string (default: )
- enabled : boolean (default: true)
- target : string
- rel : string
- width : sap.ui.core.CSSSize
- href : sap.ui.core.URI
- wrapping : boolean (default: false)
- textAlign : sap.ui.core.TextAlign (default: Initial)
- textDirection : sap.ui.core.TextDirection (default: Inherit)
- subtle : boolean (default: false)
- emphasized : boolean (default: false)
- Events
- press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
{string} | sId? | id for the new control, generated automatically if no id is given |
{object} | mSettings? | initial settings for the new control |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters |
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.
{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 |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
ariaDescribedBy
. {string|sap.ui.core.Control} | vAriaDescribedBy | the ariaDescribedBy to add; if empty, nothing is inserted |
{sap.m.Link} | Reference to this in order to allow method chaining |
ariaLabelledBy
. {string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
{sap.m.Link} | Reference to this in order to allow method chaining |
fnFunction
to the press
event of this sap.m.Link
. When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.m.Link
itself.
Event is fired when the user triggers the link control.
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.m.Link itself |
{sap.m.Link} | Reference to this in order to allow method chaining |
fnFunction
from the press
event of this sap.m.Link
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.m.Link} | Reference to this in order to allow method chaining |
press
to attached listeners. Listeners may prevent the default action of this event by using the preventDefault
-method on the event object.
{Map} | mArguments? | The arguments to pass along with the event |
{boolean} | Whether or not to prevent the default action |
ariaDescribedBy
. {sap.ui.core.Control[]} |
ariaLabelledBy
. {sap.ui.core.Control[]} |
emphasized
. Emphasized links look visually more important than regular links.
Default value is false
.
- Since:
- 1.22
{boolean} | Value of property emphasized |
enabled
. Determines whether the link can be triggered by the user.
Default value is true
.
{boolean} | Value of property enabled |
href
. The link target URI. Supports standard hyperlink behavior. If a JavaScript action should be triggered, this should not be set, but instead an event handler for the "press" event should be registered.
{sap.ui.core.URI} | Value of property href |
rel
. Specifies the value of the HTML rel
attribute.
Note: A default value of noopener noreferrer
is set only to links that have a cross-origin URL and a specified target
with value other than _self
.
- Since:
- 1.38.49
{string} | Value of property rel |
subtle
. Subtle links look more like standard text than like links. They should only be used to help with visual hierarchy between large data lists of important and less important links. Subtle links should not be used in any other use case.
Default value is false
.
- Since:
- 1.22
{boolean} | Value of property subtle |
target
. Options are the standard values for window.open() supported by browsers: _self, _top, _blank, _parent, _search. Alternatively, a frame name can be entered. This property is only used when the href property is set.
{string} | Value of property target |
text
. Link text to be displayed.
Default value is .
{string} | Value of property text |
textAlign
. Sets the horizontal alignment of the text.
Default value is Initial
.
- Since:
- 1.28.0
{sap.ui.core.TextAlign} | Value of property textAlign |
textDirection
. This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the parent DOM.
Default value is Inherit
.
- Since:
- 1.28.0
{sap.ui.core.TextDirection} | Value of property textDirection |
width
. Determines the width of the link (CSS-size such as % or px). When it is set, this is the exact size. When left blank, the text defines the size.
{sap.ui.core.CSSSize} | Value of property width |
wrapping
. Determines whether the link text is allowed to wrap when there is not sufficient space.
Default value is false
.
{boolean} | Value of property wrapping |
ariaDescribedBy
. {sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaLabelledBy
. {sap.ui.core.Control[]} | An array of the removed elements (might be empty) |
ariaDescribedBy
. {int|string|sap.ui.core.Control} | vAriaDescribedBy | The ariaDescribedByto be removed or its index or ID |
{sap.ui.core.Control} | the removed ariaDescribedBy or null |
ariaLabelledBy
. {int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
{sap.ui.core.Control} | the removed ariaLabelledBy or null |
emphasized
. Emphasized links look visually more important than regular links.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bEmphasized | New value for property emphasized |
- Since:
- 1.22
{sap.m.Link} | Reference to this in order to allow method chaining |
enabled
. Determines whether the link can be triggered by the user.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEnabled | New value for property enabled |
{sap.m.Link} | Reference to this in order to allow method chaining |
href
. The link target URI. Supports standard hyperlink behavior. If a JavaScript action should be triggered, this should not be set, but instead an event handler for the "press" event should be registered.
When called with a value of null
or undefined
, the default value of the property will be restored.
{sap.ui.core.URI} | sHref | New value for property href |
{sap.m.Link} | Reference to this in order to allow method chaining |
rel
. Specifies the value of the HTML rel
attribute.
Note: A default value of noopener noreferrer
is set only to links that have a cross-origin URL and a specified target
with value other than _self
.
When called with a value of null
or undefined
, the default value of the property will be restored.
{string} | sRel | New value for property rel |
- Since:
- 1.38.49
{sap.m.Link} | Reference to this in order to allow method chaining |
subtle
. Subtle links look more like standard text than like links. They should only be used to help with visual hierarchy between large data lists of important and less important links. Subtle links should not be used in any other use case.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bSubtle | New value for property subtle |
- Since:
- 1.22
{sap.m.Link} | Reference to this in order to allow method chaining |
target
. Options are the standard values for window.open() supported by browsers: _self, _top, _blank, _parent, _search. Alternatively, a frame name can be entered. This property is only used when the href property is set.
When called with a value of null
or undefined
, the default value of the property will be restored.
{string} | sTarget | New value for property target |
{sap.m.Link} | Reference to this in order to allow method chaining |
text
. Link text to be displayed.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is .
{string} | sText | New value for property text |
{sap.m.Link} | Reference to this in order to allow method chaining |
textAlign
. Sets the horizontal alignment of the text.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Initial
.
{sap.ui.core.TextAlign} | sTextAlign | New value for property textAlign |
- Since:
- 1.28.0
{sap.m.Link} | Reference to this in order to allow method chaining |
textDirection
. This property specifies the element's text directionality with enumerated options. By default, the control inherits text direction from the parent DOM.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
{sap.ui.core.TextDirection} | sTextDirection | New value for property textDirection |
- Since:
- 1.28.0
{sap.m.Link} | Reference to this in order to allow method chaining |
width
. Determines the width of the link (CSS-size such as % or px). When it is set, this is the exact size. When left blank, the text defines the size.
When called with a value of null
or undefined
, the default value of the property will be restored.
{sap.ui.core.CSSSize} | sWidth | New value for property width |
{sap.m.Link} | Reference to this in order to allow method chaining |
wrapping
. Determines whether the link text is allowed to wrap when there is not sufficient space.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bWrapping | New value for property wrapping |
{sap.m.Link} | Reference to this in order to allow method chaining |