Class sap.m.GenericTileModule: sap/m/GenericTile

extends Control

Displays header, subheader, and a customizable main area in a tile format. Since 1.44, also an in-line format which contains only header and subheader is supported.
Since: 1.34.
Constructor Summary
new sap.m.GenericTile(sId?, mSettings?)Constructor for a new sap.m.GenericTile control.
Event Summary
press(oControlEvent)The event is fired when the user chooses the tile.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.GenericTile.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.GenericTile with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.GenericTile.getMetadata()Returns a metadata object for class sap.m.GenericTile.
addTileContent(oTileContent)Adds some tileContent to the aggregation tileContent.
attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the press event of this sap.m.GenericTile.
bindTileContent(oBindingInfo)Binds aggregation tileContent to model data.
destroyTileContent()Destroys all the tileContent in the aggregation tileContent.
detachPress(fnFunction, oListener)Detaches event handler fnFunction from the press event of this sap.m.GenericTile.
firePress(mParameters?)Fires event press to attached listeners.
getBackgroundImage()Gets current value of property backgroundImage.
getBoundingRects()Provides an interface to the tile's layout information consistent in all modes and content densities.
getFailedText()Gets current value of property failedText.
getFrameType()Gets current value of property frameType.
getHeader()Gets current value of property header.
getHeaderImage()Gets current value of property headerImage.
getImageDescription()Gets current value of property imageDescription.
getMode()Gets current value of property mode.
getScope()Gets current value of property scope.
getState()Gets current value of property state.
getSubheader()Gets current value of property subheader.
getTileContent()Gets content of aggregation tileContent.
indexOfTileContent(oTileContent)Checks for the provided sap.m.TileContent in the aggregation tileContent.
insertTileContent(oTileContent, iIndex)Inserts a tileContent into the aggregation tileContent.
removeAllTileContent()Removes all the controls from the aggregation tileContent.
removeTileContent(vTileContent)Removes a tileContent from the aggregation tileContent.
setBackgroundImage(sBackgroundImage)Sets a new value for property backgroundImage.
setFailedText(sFailedText)Sets a new value for property failedText.
setFrameType(sFrameType)Sets a new value for property frameType.
setHeader(sHeader)Sets a new value for property header.
setHeaderImage(sHeaderImage)Sets a new value for property headerImage.
setImageDescription(sImageDescription)Sets a new value for property imageDescription.
setMode(sMode)Sets a new value for property mode.
setPressEnabled(value)Provides an interface to switch on or off the tile's press event.
setScope(sScope)Sets a new value for property scope.
setState(sState)Sets a new value for property state.
setSubheader(sSubheader)Sets a new value for property subheader.
showActionsView(value)Shows the actions scope view of GenericTile without changing the scope.
unbindTileContent()Unbinds aggregation tileContent from model data.
destroyIcon()Destroys the icon in the aggregation icon.
getIcon()Gets content of aggregation icon.
getSize()Gets current value of property size.
setIcon(oIcon)Sets the aggregated icon.
setSize(sSize)Sets a new value for property size.
Constructor Detail
new sap.m.GenericTile(sId?, mSettings?)

Constructor for a new sap.m.GenericTile 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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Aggregations

  • 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.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?initial settings for the new control
Event Detail
press(oControlEvent)
The event is fired when the user chooses the tile.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.m.GenericTileScopeoControlEvent.getParameters.scopeThe current scope the GenericTile was in when the event occurred.
stringoControlEvent.getParameters.actionThe action that was pressed on the tile. In the Actions scope, the available actions are Press and Remove. In Display scope, the parameter value is only Press.
anyoControlEvent.getParameters.domRefThe Element's DOM Element. Points to GenericTile instance DOM Element in Display scope. In Actions scope the domRef points to the DOM Element of the remove button (if pressed) or the more icon.
Method Detail
sap.m.GenericTile.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.m.GenericTile 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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.m.GenericTile.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.GenericTile.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addTileContent(oTileContent): sap.m.GenericTile
Adds some tileContent to the aggregation tileContent.
Parameters:
sap.m.TileContentoTileContentthe tileContent to add; if empty, nothing is inserted
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
attachPress(oData?, fnFunction, oListener?): sap.m.GenericTile

Attaches event handler fnFunction to the press event of this sap.m.GenericTile.

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

The event is fired when the user chooses the tile.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.GenericTile itself
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
bindTileContent(oBindingInfo): sap.m.GenericTile

Binds aggregation tileContent to model data.

See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo.

Parameters:
objectoBindingInfoThe binding information
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
destroyTileContent(): sap.m.GenericTile
Destroys all the tileContent in the aggregation tileContent.
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
detachPress(fnFunction, oListener): sap.m.GenericTile

Detaches event handler fnFunction from the press event of this sap.m.GenericTile.

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

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
firePress(mParameters?): sap.m.GenericTile
Fires event press to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.m.GenericTileScopemParameters.scope?The current scope the GenericTile was in when the event occurred.
stringmParameters.action?The action that was pressed on the tile. In the Actions scope, the available actions are Press and Remove. In Display scope, the parameter value is only Press.
anymParameters.domRef?The Element's DOM Element. Points to GenericTile instance DOM Element in Display scope. In Actions scope the domRef points to the DOM Element of the remove button (if pressed) or the more icon.
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
getBackgroundImage(): sap.ui.core.URI

Gets current value of property backgroundImage.

The URI of the background image.

Returns:
sap.ui.core.URIValue of property backgroundImage
getBoundingRects(): object[]
Provides an interface to the tile's layout information consistent in all modes and content densities.
Returns:
object[]An array containing all of the tile's bounding rectangles
Experimental API:
since 1.44.1 This method's implementation is subject to change
getFailedText(): string

Gets current value of property failedText.

The message that appears when the control is in the Failed state.

Returns:
stringValue of property failedText
getFrameType(): sap.m.FrameType

Gets current value of property frameType.

The frame type: OneByOne or TwoByOne. Set to OneByOne as default if no property is defined or set to Auto by the app.

Default value is OneByOne.

Returns:
sap.m.FrameTypeValue of property frameType
getHeader(): string

Gets current value of property header.

The header of the tile.

Returns:
stringValue of property header
getHeaderImage(): sap.ui.core.URI

Gets current value of property headerImage.

The image to be displayed as a graphical element within the header. This can be an image or an icon from the icon font.

Returns:
sap.ui.core.URIValue of property headerImage
getImageDescription(): string

Gets current value of property imageDescription.

Description of a header image that is used in the tooltip.

Returns:
stringValue of property imageDescription

Gets current value of property mode.

The mode of the GenericTile.

Default value is ContentMode.

Returns:
sap.m.GenericTileModeValue of property mode

Gets current value of property scope.

Changes the visualization in order to enable additional actions with the Generic Tile.

Default value is Display.

Returns:
sap.m.GenericTileScopeValue of property scope
Since:
1.46.0
getState(): sap.m.LoadState

Gets current value of property state.

The load status.

Default value is Loaded.

Returns:
sap.m.LoadStateValue of property state
getSubheader(): string

Gets current value of property subheader.

The subheader of the tile.

Returns:
stringValue of property subheader
getTileContent(): sap.m.TileContent[]

Gets content of aggregation tileContent.

The content of the tile.

Returns:
sap.m.TileContent[]
indexOfTileContent(oTileContent): int
Checks for the provided sap.m.TileContent in the aggregation tileContent. and returns its index if found or -1 otherwise.
Parameters:
sap.m.TileContentoTileContentThe tileContent whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertTileContent(oTileContent, iIndex): sap.m.GenericTile
Inserts a tileContent into the aggregation tileContent.
Parameters:
sap.m.TileContentoTileContentthe tileContent to insert; if empty, nothing is inserted
intiIndexthe 0-based index the tileContent should be inserted at; for a negative value of iIndex, the tileContent is inserted at position 0; for a value greater than the current size of the aggregation, the tileContent is inserted at the last position
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
removeAllTileContent(): sap.m.TileContent[]

Removes all the controls from the aggregation tileContent.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.m.TileContent[]An array of the removed elements (might be empty)
removeTileContent(vTileContent): sap.m.TileContent
Removes a tileContent from the aggregation tileContent.
Parameters:
int|string|sap.m.TileContentvTileContentThe tileContent to remove or its index or id
Returns:
sap.m.TileContentThe removed tileContent or null
setBackgroundImage(sBackgroundImage): sap.m.GenericTile

Sets a new value for property backgroundImage.

The URI of the background image.

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

Parameters:
sap.ui.core.URIsBackgroundImageNew value for property backgroundImage
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setFailedText(sFailedText): sap.m.GenericTile

Sets a new value for property failedText.

The message that appears when the control is in the Failed state.

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

Parameters:
stringsFailedTextNew value for property failedText
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setFrameType(sFrameType): sap.m.GenericTile

Sets a new value for property frameType.

The frame type: OneByOne or TwoByOne. Set to OneByOne as default if no property is defined or set to Auto by the app.

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

Default value is OneByOne.

Parameters:
sap.m.FrameTypesFrameTypeNew value for property frameType
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setHeader(sHeader): sap.m.GenericTile

Sets a new value for property header.

The header of the tile.

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

Parameters:
stringsHeaderNew value for property header
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setHeaderImage(sHeaderImage): sap.m.GenericTile

Sets a new value for property headerImage.

The image to be displayed as a graphical element within the header. This can be an image or an icon from the icon font.

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

Parameters:
sap.ui.core.URIsHeaderImageNew value for property headerImage
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setImageDescription(sImageDescription): sap.m.GenericTile

Sets a new value for property imageDescription.

Description of a header image that is used in the tooltip.

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

Parameters:
stringsImageDescriptionNew value for property imageDescription
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setMode(sMode): sap.m.GenericTile

Sets a new value for property mode.

The mode of the GenericTile.

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

Default value is ContentMode.

Parameters:
sap.m.GenericTileModesModeNew value for property mode
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setPressEnabled(value)
Provides an interface to switch on or off the tile's press event. Used in SlideTile for Actions scope.
Parameters:
booleanvalueIf set to true, the press event of the tile is active.
Since:
1.46
setScope(sScope): sap.m.GenericTile

Sets a new value for property scope.

Changes the visualization in order to enable additional actions with the Generic Tile.

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

Default value is Display.

Parameters:
sap.m.GenericTileScopesScopeNew value for property scope
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
Since:
1.46.0
setState(sState): sap.m.GenericTile

Sets a new value for property state.

The load status.

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

Default value is Loaded.

Parameters:
sap.m.LoadStatesStateNew value for property state
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
setSubheader(sSubheader): sap.m.GenericTile

Sets a new value for property subheader.

The subheader of the tile.

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

Parameters:
stringsSubheaderNew value for property subheader
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
showActionsView(value)
Shows the actions scope view of GenericTile without changing the scope. Used in SlideTile for Actions scope.
Parameters:
booleanvalueIf set to true, actions view is showed.
Since:
1.46
unbindTileContent(): sap.m.GenericTile
Unbinds aggregation tileContent from model data.
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
destroyIcon(): sap.m.GenericTile
Destroys the icon in the aggregation icon.
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
Deprecated API:
Since version 1.36.0. This aggregation is deprecated, use sap.m.TileContent control to display an icon instead.

Gets content of aggregation icon.

An icon or image to be displayed in the control. This aggregation is deprecated since version 1.36.0, to display an icon or image use sap.m.TileContent control instead.

Returns:
sap.ui.core.Control
Deprecated API:
Since version 1.36.0. This aggregation is deprecated, use sap.m.TileContent control to display an icon instead.
getSize(): sap.m.Size

Gets current value of property size.

The size of the tile. If not set, then the default size is applied based on the device.

Default value is Auto.

Returns:
sap.m.SizeValue of property size
Deprecated API:
Since version 1.38.0. The GenericTile control has now a fixed size, depending on the used media (desktop, tablet or phone).
setIcon(oIcon): sap.m.GenericTile
Sets the aggregated icon.
Parameters:
sap.ui.core.ControloIconThe icon to set
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
Deprecated API:
Since version 1.36.0. This aggregation is deprecated, use sap.m.TileContent control to display an icon instead.
setSize(sSize): sap.m.GenericTile

Sets a new value for property size.

The size of the tile. If not set, then the default size is applied based on the device.

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

Default value is Auto.

Parameters:
sap.m.SizesSizeNew value for property size
Returns:
sap.m.GenericTileReference to this in order to allow method chaining
Deprecated API:
Since version 1.38.0. The GenericTile control has now a fixed size, depending on the used media (desktop, tablet or phone).