namespace sap.m.URLHelper

Control sample: sap.m.URLHelper
Visiblity: public
Available since: N/A
Module: sap/m/library
Application Component: CA-UI5-CTR

URL (Uniform Resource Locator) Helper.

This helper can be used to trigger a native application (e.g. email, sms, phone) from the browser. That means we are restricted of browser or application implementation. e.g.

Note: all the given maximum lengths are for URL encoded text (e.g a space character will be encoded as "%20").

It has been reported by some users that the content send through the URLHelper is not correctly displayed by the native applications (e.g. a native mail application).

After sending the body to the application, URLHelper cannot affect its rendering and the application takes responsibility to correctly display the content. Inconsistencies between different native applications or operative systems (OS) can lead to different behaviors and differences in the displayed content.

Example:

What happens with a link added to the content of an email using the URLHelper ?

Apart from the correct generation of URL, everything else is outside of the scope of URLHelper as responsibility from then on is passed to the browser and the native applications handling the URL. For instance, clicking on an email link should result in triggering an action in the default mail application for the user's OS and it is this application's responsibility to correctly handle the URL, given it is generated correctly.



References:


Nodes Overview

Node Description

Methods Overview

Method Description
sap.m.URLHelper.attachRedirect

Adds an event listener for the redirect event.

sap.m.URLHelper.detachRedirect

Detach an already registered listener of the redirect event.

sap.m.URLHelper.normalizeEmail

Builds Email URI from given parameter. Trims spaces from email addresses.

sap.m.URLHelper.normalizeSms

Sanitizes the given telephone number and returns a URI using the sms: scheme.

sap.m.URLHelper.normalizeTel

Sanitizes the given telephone number and returns a URI using the tel: scheme.

sap.m.URLHelper.redirect

Redirects to the given URL.

This method fires "redirect" event before opening the URL.

sap.m.URLHelper.triggerEmail

Trigger email application to send email. Trims spaces from email addresses.

sap.m.URLHelper.triggerSms

Trigger SMS application to send SMS to given telephone number.

sap.m.URLHelper.triggerTel

Trigger telephone app to call the given telephone number.

sap.m.URLHelper.attachRedirect

Adds an event listener for the redirect event.

Param Type DefaultValue Description
fnFunction function

The function to call, when the event occurs.

oListener Object

The object that wants to be notified when the event occurs.

sap.m.URLHelper.detachRedirect

Detach an already registered listener of the redirect event.

Param Type DefaultValue Description
fnFunction function

The function to call, when the event occurs.

oListener Object

The object, that wants to be notified, when the event occurs.

sap.m.URLHelper.normalizeEmail

Builds Email URI from given parameter. Trims spaces from email addresses.

Param Type DefaultValue Description
sEmail string

Destination email address

sSubject string

Subject of the email address

sBody string

Default message text

sCC string

Carbon Copy email address

sBCC string

Blind carbon copy email address

sap.m.URLHelper.normalizeSms

Sanitizes the given telephone number and returns a URI using the sms: scheme.

Param Type DefaultValue Description
sTel string

Telephone number

sap.m.URLHelper.normalizeTel

Sanitizes the given telephone number and returns a URI using the tel: scheme.

Param Type DefaultValue Description
sTel string

Telephone number

sap.m.URLHelper.redirect

Redirects to the given URL.

This method fires "redirect" event before opening the URL.

Param Type DefaultValue Description
sURL string

Uniform resource locator

bNewWindow boolean

Opens URL in a new browser window or tab. Please note that, opening a new window/tab can be ignored by browsers (e.g. on Windows Phone) or by popup blockers. NOTE: On Windows Phone the URL will be enforced to open in the same window if opening in a new window/tab fails (because of a known system restriction on cross-window communications). Use sap.m.Link instead (with blank target) if you necessarily need to open URL in a new window.

sap.m.URLHelper.triggerEmail

Trigger email application to send email. Trims spaces from email addresses.

Param Type DefaultValue Description
sEmail string

Destination email address

sSubject string

Subject of the email address

sBody string

Default message text

sCC string

Carbon Copy email address

sBCC string

Blind carbon copy email address

bNewWindow boolean

Opens email template in a new browser window or tab.

sap.m.URLHelper.triggerSms

Trigger SMS application to send SMS to given telephone number.

Param Type DefaultValue Description
sTel string

Telephone number

sap.m.URLHelper.triggerTel

Trigger telephone app to call the given telephone number.

Param Type DefaultValue Description
sTel string

Telephone number