Class sap.m.FeedListItemModule: sap/m/FeedListItem

extends ListItemBase
known direct subclasses: ExpansibleFeedListItem

The control provides a set of properties for text, sender information, time stamp. Beginning with release 1.23 the new feature expand / collapse was introduced, which uses the property maxCharacters.


Since: 1.12.
Constructor Summary
new sap.m.FeedListItem(sId?, mSettings?)Constructor for a new FeedListItem.
Fields borrowed from class sap.m.ListItemBase
Event Summary
iconPress(oControlEvent)Event is fired when the icon is pressed.
senderPress(oControlEvent)Event is fired when name of the sender is pressed.
Events borrowed from class sap.m.ListItemBase
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.FeedListItem.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.FeedListItem with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.FeedListItem.getMetadata()Returns a metadata object for class sap.m.FeedListItem.
attachIconPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the iconPress event of this sap.m.FeedListItem.
attachSenderPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the senderPress event of this sap.m.FeedListItem.
detachIconPress(fnFunction, oListener)Detaches event handler fnFunction from the iconPress event of this sap.m.FeedListItem.
detachSenderPress(fnFunction, oListener)Detaches event handler fnFunction from the senderPress event of this sap.m.FeedListItem.
fireIconPress(mArguments?)Fires event iconPress to attached listeners.
fireSenderPress(mArguments?)Fires event senderPress to attached listeners.
getActiveIcon()Gets current value of property activeIcon.
getIcon()Gets current value of property icon.
getIconActive()Gets current value of property iconActive.
getIconDensityAware()Gets current value of property iconDensityAware.
getInfo()Gets current value of property info.
getMaxCharacters()Gets current value of property maxCharacters.
getSender()Gets current value of property sender.
getSenderActive()Gets current value of property senderActive.
getShowIcon()Gets current value of property showIcon.
getText()Gets current value of property text.
getTimestamp()Gets current value of property timestamp.
setActiveIcon(sActiveIcon)Sets a new value for property activeIcon.
setIcon(sIcon)Sets a new value for property icon.
setIconActive(bIconActive)Sets a new value for property iconActive.
setIconDensityAware(bIconDensityAware)Sets a new value for property iconDensityAware.
setInfo(sInfo)Sets a new value for property info.
setMaxCharacters(iMaxCharacters)Sets a new value for property maxCharacters.
setSender(sSender)Sets a new value for property sender.
setSenderActive(bSenderActive)Sets a new value for property senderActive.
setShowIcon(bShowIcon)Sets a new value for property showIcon.
setText(sText)Sets a new value for property text.
setTimestamp(sTimestamp)Sets a new value for property timestamp.
setType(type)Redefinition of sap.m.ListItemBase.setType: type = "sap.m.ListType.Navigation" behaves like type = "sap.m.ListType.Active" for a FeedListItem
setUnread(value)Redefinition of sap.m.ListItemBase.setUnread: Unread is not supported for FeedListItem
Constructor Detail
new sap.m.FeedListItem(sId?, mSettings?)
Constructor for a new FeedListItem.

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:

In addition, all settings applicable to the base type sap.m.ListItemBase 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
iconPress(oControlEvent)
Event is fired when the icon is pressed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.domRef Dom reference of the feed item's icon to be used for positioning.
{function}oControlEvent.getParameters.getDomRef Function to retrieve the DOM reference for the iconPress event. The function returns the DOM element of the icon or null
senderPress(oControlEvent)
Event is fired when name of the sender is pressed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.domRef Dom reference of the feed item's sender string to be used for positioning.
{function}oControlEvent.getParameters.getDomRef Function to retrieve the DOM reference for the senderPress event. The function returns the DOM element of the sender link or null
Method Detail
sap.m.FeedListItem.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.FeedListItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.ListItemBase.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.FeedListItem.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.FeedListItem.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachIconPress(oData?, fnFunction, oListener?): sap.m.FeedListItem
Attaches event handler fnFunction to the iconPress event of this sap.m.FeedListItem.

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

Event is fired when the icon is pressed.

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.FeedListItem itself
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
attachSenderPress(oData?, fnFunction, oListener?): sap.m.FeedListItem
Attaches event handler fnFunction to the senderPress event of this sap.m.FeedListItem.

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

Event is fired when name of the sender is pressed.

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.FeedListItem itself
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
detachIconPress(fnFunction, oListener): sap.m.FeedListItem
Detaches event handler fnFunction from the iconPress event of this sap.m.FeedListItem.

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.FeedListItem} Reference to this in order to allow method chaining
detachSenderPress(fnFunction, oListener): sap.m.FeedListItem
Detaches event handler fnFunction from the senderPress event of this sap.m.FeedListItem.

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.FeedListItem} Reference to this in order to allow method chaining
fireIconPress(mArguments?): sap.m.FeedListItem
Fires event iconPress to attached listeners.

Expects the following event parameters:

  • domRef of type stringDom reference of the feed item's icon to be used for positioning.
  • getDomRef of type functionFunction to retrieve the DOM reference for the iconPress event. The function returns the DOM element of the icon or null
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
fireSenderPress(mArguments?): sap.m.FeedListItem
Fires event senderPress to attached listeners.

Expects the following event parameters:

  • domRef of type stringDom reference of the feed item's sender string to be used for positioning.
  • getDomRef of type functionFunction to retrieve the DOM reference for the senderPress event. The function returns the DOM element of the sender link or null
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
getActiveIcon(): sap.ui.core.URI
Gets current value of property activeIcon.

Icon displayed when the list item is active.

Returns:
{sap.ui.core.URI} Value of property activeIcon
getIcon(): sap.ui.core.URI
Gets current value of property icon.

Icon to be displayed as graphical element within the FeedListItem. This can be an image or an icon from the icon font. If no icon is provided, a default person-placeholder icon is displayed. Icon is only shown if showIcon = true.

Returns:
{sap.ui.core.URI} Value of property icon
getIconActive(): boolean
Gets current value of property iconActive.

If true, icon is an link, which will fire 'iconPress' events. If false, icon is normal image

Default value is true.

Returns:
{boolean} Value of property iconActive
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
getInfo(): string
Gets current value of property info.

The Info text.

Returns:
{string} Value of property info
getMaxCharacters(): int
Gets current value of property maxCharacters.

The expand and collapse feature is set by default and uses 300 characters on mobile devices and 500 characters on desktops as limits. Based on these values, the text of the FeedListItem is collapsed once text reaches these limits. In this case, only the specified number of characters is displayed. By clicking on the text link More, the entire text can be displayed. The text link Less collapses the text. The application is able to set the value to its needs.

Returns:
{int} Value of property maxCharacters
getSender(): string
Gets current value of property sender.

Sender of the chunk

Returns:
{string} Value of property sender
getSenderActive(): boolean
Gets current value of property senderActive.

If true, sender string is an link, which will fire 'senderPress' events. If false, sender is normal text.

Default value is true.

Returns:
{boolean} Value of property senderActive
getShowIcon(): boolean
Gets current value of property showIcon.

If set to "true" (default), icons will be displayed, if set to false icons are hidden

Default value is true.

Returns:
{boolean} Value of property showIcon
getText(): string
Gets current value of property text.

The FeedListItem text.

Returns:
{string} Value of property text
getTimestamp(): string
Gets current value of property timestamp.

This chunks timestamp

Returns:
{string} Value of property timestamp
setActiveIcon(sActiveIcon): sap.m.FeedListItem
Sets a new value for property activeIcon.

Icon displayed when the list item is active.

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

Parameters:
{sap.ui.core.URI}sActiveIcon New value for property activeIcon
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setIcon(sIcon): sap.m.FeedListItem
Sets a new value for property icon.

Icon to be displayed as graphical element within the FeedListItem. This can be an image or an icon from the icon font. If no icon is provided, a default person-placeholder icon is displayed. Icon is only shown if showIcon = true.

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

Parameters:
{sap.ui.core.URI}sIcon New value for property icon
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setIconActive(bIconActive): sap.m.FeedListItem
Sets a new value for property iconActive.

If true, icon is an link, which will fire 'iconPress' events. If false, icon is normal image

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

Default value is true.

Parameters:
{boolean}bIconActive New value for property iconActive
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setIconDensityAware(bIconDensityAware): sap.m.FeedListItem
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.FeedListItem} Reference to this in order to allow method chaining
setInfo(sInfo): sap.m.FeedListItem
Sets a new value for property info.

The Info text.

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

Parameters:
{string}sInfo New value for property info
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setMaxCharacters(iMaxCharacters): sap.m.FeedListItem
Sets a new value for property maxCharacters.

The expand and collapse feature is set by default and uses 300 characters on mobile devices and 500 characters on desktops as limits. Based on these values, the text of the FeedListItem is collapsed once text reaches these limits. In this case, only the specified number of characters is displayed. By clicking on the text link More, the entire text can be displayed. The text link Less collapses the text. The application is able to set the value to its needs.

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

Parameters:
{int}iMaxCharacters New value for property maxCharacters
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setSender(sSender): sap.m.FeedListItem
Sets a new value for property sender.

Sender of the chunk

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

Parameters:
{string}sSender New value for property sender
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setSenderActive(bSenderActive): sap.m.FeedListItem
Sets a new value for property senderActive.

If true, sender string is an link, which will fire 'senderPress' events. If false, sender is normal text.

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

Default value is true.

Parameters:
{boolean}bSenderActive New value for property senderActive
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setShowIcon(bShowIcon): sap.m.FeedListItem
Sets a new value for property showIcon.

If set to "true" (default), icons will be displayed, if set to false icons are hidden

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

Default value is true.

Parameters:
{boolean}bShowIcon New value for property showIcon
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setText(sText): sap.m.FeedListItem
Sets a new value for property text.

The FeedListItem text.

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

Parameters:
{string}sText New value for property text
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setTimestamp(sTimestamp): sap.m.FeedListItem
Sets a new value for property timestamp.

This chunks timestamp

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

Parameters:
{string}sTimestamp New value for property timestamp
Returns:
{sap.m.FeedListItem} Reference to this in order to allow method chaining
setType(type): sap.m.FeedListItem
Redefinition of sap.m.ListItemBase.setType: type = "sap.m.ListType.Navigation" behaves like type = "sap.m.ListType.Active" for a FeedListItem
Parameters:
{sap.m.ListType}type new value for property type
Returns:
{sap.m.FeedListItem} this allows method chaining
setUnread(value): sap.m.FeedListItem
Redefinition of sap.m.ListItemBase.setUnread: Unread is not supported for FeedListItem
Parameters:
{boolean}value new value for property unread is ignored
Returns:
{sap.m.FeedListItem} this allows method chaining