class sap.m.PullToRefresh

Control sample: sap.m.PullToRefresh
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/PullToRefresh
Application Component: CA-UI5-CTR

PullToRefresh control. Put it as the first control in contents of a scroll container or a scrollable page. Do not place it into a page with disabled scrolling. On touch devices it gets hidden by default and when the user pulls down the page far enough, it gets visible and triggers the "refresh" event. In non-touch browsers where scrollbars are used for scrolling, it is always visible and triggers the "refresh" event when clicked.


Constructor

Constructor for a new PullToRefresh.

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.PullToRefresh(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
customIcon sap.ui.core.URI

Provide a URI to a custom icon image to replace the SAP logo. Large images are scaled down to max 50px height.

Visibility: public
description string

Optional description. May be used to inform a user, for example, when the list has been updated last time.

Visibility: public
iconDensityAware boolean true

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server.

If bandwidth is the key for the application, set this value to false.

Visibility: public
showIcon boolean false

Set to true to display an icon/logo. Icon must be set either in the customIcon property or in the CSS theme for the PullToRefresh control.

Visibility: public

Events Overview

Event Description
refresh

Event indicates that the user has requested new data

refresh

Event indicates that the user has requested new data

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
attachRefresh

Attaches event handler fnFunction to the refresh event of this sap.m.PullToRefresh.

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.PullToRefresh itself.

Event indicates that the user has requested new data

detachRefresh

Detaches event handler fnFunction from the refresh event of this sap.m.PullToRefresh.

The passed function and listener object must match the ones used for event registration.

sap.m.PullToRefresh.extend

Creates a new subclass of class sap.m.PullToRefresh 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.

fireRefresh

Fires event refresh to attached listeners.

getCustomIcon

Gets current value of property customIcon.

Provide a URI to a custom icon image to replace the SAP logo. Large images are scaled down to max 50px height.

getDescription

Gets current value of property description.

Optional description. May be used to inform a user, for example, when the list has been updated last time.

getIconDensityAware

Gets current value of property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server.

If bandwidth is the key for the application, set this value to false.

Default value is true.

sap.m.PullToRefresh.getMetadata

Returns a metadata object for class sap.m.PullToRefresh.

getShowIcon

Gets current value of property showIcon.

Set to true to display an icon/logo. Icon must be set either in the customIcon property or in the CSS theme for the PullToRefresh control.

Default value is false.

hide

Hides the control and resets it to the normal state. In non-touch environments the control is not hidden.

setCustomIcon

Sets a new value for property customIcon.

Provide a URI to a custom icon image to replace the SAP logo. Large images are scaled down to max 50px height.

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

setDescription

Sets a new value for property description.

Optional description. May be used to inform a user, for example, when the list has been updated last time.

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

setIconDensityAware

Sets a new value for property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server.

If bandwidth is the key for the application, set this value to false.

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

Default value is true.

setShowIcon

Sets a new value for property showIcon.

Set to true to display an icon/logo. Icon must be set either in the customIcon property or in the CSS theme for the PullToRefresh control.

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

Default value is false.

attachRefresh

Attaches event handler fnFunction to the refresh event of this sap.m.PullToRefresh.

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.PullToRefresh itself.

Event indicates that the user has requested new data

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.PullToRefresh itself

detachRefresh

Detaches event handler fnFunction from the refresh event of this sap.m.PullToRefresh.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.PullToRefresh.extend

Creates a new subclass of class sap.m.PullToRefresh 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

fireRefresh

Fires event refresh to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getCustomIcon

Gets current value of property customIcon.

Provide a URI to a custom icon image to replace the SAP logo. Large images are scaled down to max 50px height.

getDescription

Gets current value of property description.

Optional description. May be used to inform a user, for example, when the list has been updated last time.

getIconDensityAware

Gets current value of property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server.

If bandwidth is the key for the application, set this value to false.

Default value is true.

sap.m.PullToRefresh.getMetadata

Returns a metadata object for class sap.m.PullToRefresh.

getShowIcon

Gets current value of property showIcon.

Set to true to display an icon/logo. Icon must be set either in the customIcon property or in the CSS theme for the PullToRefresh control.

Default value is false.

hide

Hides the control and resets it to the normal state. In non-touch environments the control is not hidden.

setCustomIcon

Sets a new value for property customIcon.

Provide a URI to a custom icon image to replace the SAP logo. Large images are scaled down to max 50px height.

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

Param Type DefaultValue Description
sCustomIcon sap.ui.core.URI

New value for property customIcon

setDescription

Sets a new value for property description.

Optional description. May be used to inform a user, for example, when the list has been updated last time.

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

Param Type DefaultValue Description
sDescription string

New value for property description

setIconDensityAware

Sets a new value for property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image if this version of image doesn't exist on the server.

If bandwidth is the key for the application, set this value to false.

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

Default value is true.

Param Type DefaultValue Description
bIconDensityAware boolean true

New value for property iconDensityAware

setShowIcon

Sets a new value for property showIcon.

Set to true to display an icon/logo. Icon must be set either in the customIcon property or in the CSS theme for the PullToRefresh control.

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
bShowIcon boolean false

New value for property showIcon