Class sap.m.PullToRefreshModule: sap/m/PullToRefresh

extends Control

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.


Since: 1.9.2.
Constructor Summary
new sap.m.PullToRefresh(sId?, mSettings?)Constructor for a new PullToRefresh.
Event Summary
refresh(oControlEvent)Event indicates that the user has requested new data
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.PullToRefresh.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.PullToRefresh with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.PullToRefresh.getMetadata()Returns a metadata object for class sap.m.PullToRefresh.
attachRefresh(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the refresh event of this sap.m.PullToRefresh.
detachRefresh(fnFunction, oListener)Detaches event handler fnFunction from the refresh event of this sap.m.PullToRefresh.
fireRefresh(mArguments?)Fires event refresh to attached listeners.
getCustomIcon()Gets current value of property customIcon.
getDescription()Gets current value of property description.
getIconDensityAware()Gets current value of property iconDensityAware.
getShowIcon()Gets current value of property showIcon.
hide()Hides the control and resets it to the normal state.
setCustomIcon(sCustomIcon)Sets a new value for property customIcon.
setDescription(sDescription)Sets a new value for property description.
setIconDensityAware(bIconDensityAware)Sets a new value for property iconDensityAware.
setShowIcon(bShowIcon)Sets a new value for property showIcon.
Constructor Detail
new sap.m.PullToRefresh(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
  • Events
    • refresh : 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.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
refresh(oControlEvent)
Event indicates that the user has requested new data
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.m.PullToRefresh.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

Parameters:
{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
Returns:
{function} Created class / constructor function
sap.m.PullToRefresh.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.PullToRefresh.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachRefresh(oData?, fnFunction, oListener?): sap.m.PullToRefresh
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

Parameters:
{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.PullToRefresh itself
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
detachRefresh(fnFunction, oListener): sap.m.PullToRefresh
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
fireRefresh(mArguments?): sap.m.PullToRefresh
Fires event refresh to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
getCustomIcon(): sap.ui.core.URI
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.

Returns:
{sap.ui.core.URI} Value of property customIcon
getDescription(): string
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.

Returns:
{string} Value of property description
getIconDensityAware(): boolean
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.

Returns:
{boolean} Value of property iconDensityAware
getShowIcon(): boolean
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.

Returns:
{boolean} Value of property showIcon
hide(): void
Hides the control and resets it to the normal state. In non-touch environments the control is not hidden.
setCustomIcon(sCustomIcon): sap.m.PullToRefresh
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.

Parameters:
{sap.ui.core.URI}sCustomIcon New value for property customIcon
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
setDescription(sDescription): sap.m.PullToRefresh
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.

Parameters:
{string}sDescription New value for property description
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
setIconDensityAware(bIconDensityAware): sap.m.PullToRefresh
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.

Parameters:
{boolean}bIconDensityAware New value for property iconDensityAware
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining
setShowIcon(bShowIcon): sap.m.PullToRefresh
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.

Parameters:
{boolean}bShowIcon New value for property showIcon
Returns:
{sap.m.PullToRefresh} Reference to this in order to allow method chaining