Class sap.ui.vk.ListPanelModule: sap/ui/vk/ListPanel

extends Control

Aggregation control for the Legend

Experimental API:Since 1.38.0 This class is experimental and might be modified or removed in future versions.

Constructor Summary
new sap.ui.vk.ListPanel(sId?, mSettings?)Constructor for a new ListPanel.
Event Summary
expand(oControlEvent)Event is fired if the panel is expanded of collapsed
headerIconPress(oControlEvent)Event is fired if the header icon is pressed
itemPress(oControlEvent)Event is fired when an item is pressed unless the item's type property is Inactive.
selectionChange(oControlEvent)Event is fired when selection is changed via user interaction inside the control.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.vk.ListPanel.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vk.ListPanel with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vk.ListPanel.getMetadata()Returns a metadata object for class sap.ui.vk.ListPanel.
addItem(oItem)Adds some item to the aggregation items.
attachExpand(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the expand event of this sap.ui.vk.ListPanel.
attachHeaderIconPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the headerIconPress event of this sap.ui.vk.ListPanel.
attachItemPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the itemPress event of this sap.ui.vk.ListPanel.
attachSelectionChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the selectionChange event of this sap.ui.vk.ListPanel.
destroyItems()Destroys all the items in the aggregation items.
detachExpand(fnFunction, oListener)Detaches event handler fnFunction from the expand event of this sap.ui.vk.ListPanel.
detachHeaderIconPress(fnFunction, oListener)Detaches event handler fnFunction from the headerIconPress event of this sap.ui.vk.ListPanel.
detachItemPress(fnFunction, oListener)Detaches event handler fnFunction from the itemPress event of this sap.ui.vk.ListPanel.
detachSelectionChange(fnFunction, oListener)Detaches event handler fnFunction from the selectionChange event of this sap.ui.vk.ListPanel.
fireExpand(mArguments?)Fires event expand to attached listeners.
fireHeaderIconPress(mArguments?)Fires event headerIconPress to attached listeners.
fireItemPress(mArguments?)Fires event itemPress to attached listeners.
fireSelectionChange(mArguments?)Fires event selectionChange to attached listeners.
getExpandAnimation()Gets current value of property expandAnimation.
getExpanded()Gets current value of property expanded.
getHeaderIcon()Gets current value of property headerIcon.
getHeaderText()Gets current value of property headerText.
getItems()Gets content of aggregation items.
getSelectedItem()Returns selected list item.
getSelectedItems()Returns an array containing the selected list items.
getSelectionMode()Gets current value of property selectionMode.
indexOfItem(oItem)Checks for the provided sap.m.ListItemBase in the aggregation items.
insertItem(oItem, iIndex)Inserts a item into the aggregation items.
removeAllItems()Removes all the controls from the aggregation items.
removeItem(vItem)Removes a item from the aggregation items.
setExpandAnimation(bExpandAnimation)Sets a new value for property expandAnimation.
setExpanded(bExpanded)Sets a new value for property expanded.
setHeaderIcon(sHeaderIcon)Sets a new value for property headerIcon.
setHeaderText(sHeaderText)Sets a new value for property headerText.
setSelectedItem(oListItem, bSelect)Selects or deselects the given list item.
setSelectionMode(sSelectionMode)Sets a new value for property selectionMode.
Constructor Detail
new sap.ui.vk.ListPanel(sId?, mSettings?)
Constructor for a new ListPanel.

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
    • items : sap.m.ListItemBase[]
  • Events
    • headerIconPress : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • expand : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • selectionChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • itemPress : 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
expand(oControlEvent)
Event is fired if the panel is expanded of collapsed
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
headerIconPress(oControlEvent)
Event is fired if the header icon is pressed
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
itemPress(oControlEvent)
Event is fired when an item is pressed unless the item's type property is Inactive.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.m.ListItemBase}oControlEvent.getParameters.listItem The item which fired the pressed event.
{sap.ui.core.Control}oControlEvent.getParameters.srcControl The control which caused the press event within the container.
selectionChange(oControlEvent)
Event is fired when selection is changed via user interaction inside the control.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.m.ListItemBase}oControlEvent.getParameters.listItem The item whose selection has changed. In MultiSelect mode, only the up-most selected item is returned. This parameter can be used for single-selection modes.
{sap.m.ListItemBase[]}oControlEvent.getParameters.listItems Array of items whose selection has changed. This parameter can be used for MultiSelect mode.
{boolean}oControlEvent.getParameters.selected Indicates whether the listItem parameter is selected or not.
Method Detail
sap.ui.vk.ListPanel.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vk.ListPanel 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.ui.vk.ListPanel.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vk.ListPanel.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addItem(oItem): sap.ui.vk.ListPanel
Adds some item to the aggregation items.
Parameters:
{sap.m.ListItemBase}oItem the item to add; if empty, nothing is inserted
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
attachExpand(oData?, fnFunction, oListener?): sap.ui.vk.ListPanel
Attaches event handler fnFunction to the expand event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel itself.

Event is fired if the panel is expanded of collapsed

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.ui.vk.ListPanel itself
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
attachHeaderIconPress(oData?, fnFunction, oListener?): sap.ui.vk.ListPanel
Attaches event handler fnFunction to the headerIconPress event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel itself.

Event is fired if the header 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.ui.vk.ListPanel itself
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
attachItemPress(oData?, fnFunction, oListener?): sap.ui.vk.ListPanel
Attaches event handler fnFunction to the itemPress event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel itself.

Event is fired when an item is pressed unless the item's type property is Inactive.

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.ui.vk.ListPanel itself
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
attachSelectionChange(oData?, fnFunction, oListener?): sap.ui.vk.ListPanel
Attaches event handler fnFunction to the selectionChange event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel itself.

Event is fired when selection is changed via user interaction inside the control.

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.ui.vk.ListPanel itself
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
destroyItems(): sap.ui.vk.ListPanel
Destroys all the items in the aggregation items.
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
detachExpand(fnFunction, oListener): sap.ui.vk.ListPanel
Detaches event handler fnFunction from the expand event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel} Reference to this in order to allow method chaining
detachHeaderIconPress(fnFunction, oListener): sap.ui.vk.ListPanel
Detaches event handler fnFunction from the headerIconPress event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel} Reference to this in order to allow method chaining
detachItemPress(fnFunction, oListener): sap.ui.vk.ListPanel
Detaches event handler fnFunction from the itemPress event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel} Reference to this in order to allow method chaining
detachSelectionChange(fnFunction, oListener): sap.ui.vk.ListPanel
Detaches event handler fnFunction from the selectionChange event of this sap.ui.vk.ListPanel.

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.ui.vk.ListPanel} Reference to this in order to allow method chaining
fireExpand(mArguments?): sap.ui.vk.ListPanel
Fires event expand to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
fireHeaderIconPress(mArguments?): sap.ui.vk.ListPanel
Fires event headerIconPress to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
fireItemPress(mArguments?): sap.ui.vk.ListPanel
Fires event itemPress to attached listeners.

Expects the following event parameters:

  • listItem of type sap.m.ListItemBaseThe item which fired the pressed event.
  • srcControl of type sap.ui.core.ControlThe control which caused the press event within the container.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
fireSelectionChange(mArguments?): sap.ui.vk.ListPanel
Fires event selectionChange to attached listeners.

Expects the following event parameters:

  • listItem of type sap.m.ListItemBaseThe item whose selection has changed. In MultiSelect mode, only the up-most selected item is returned. This parameter can be used for single-selection modes.
  • listItems of type sap.m.ListItemBase[]Array of items whose selection has changed. This parameter can be used for MultiSelect mode.
  • selected of type booleanIndicates whether the listItem parameter is selected or not.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
getExpandAnimation(): boolean
Gets current value of property expandAnimation.

Expand animation

Default value is true.

Returns:
{boolean} Value of property expandAnimation
getExpanded(): boolean
Gets current value of property expanded.

Expansion state

Default value is true.

Returns:
{boolean} Value of property expanded
getHeaderIcon(): sap.ui.core.URI
Gets current value of property headerIcon.

Header icon

Returns:
{sap.ui.core.URI} Value of property headerIcon
getHeaderText(): string
Gets current value of property headerText.

Header text

Returns:
{string} Value of property headerText
getItems(): sap.m.ListItemBase[]
Gets content of aggregation items.

Item aggregation

Returns:
{sap.m.ListItemBase[]}
getSelectedItem(): sap.m.ListItemBase
Returns selected list item. When no item is selected, "null" is returned. When "multi-selection" is enabled and multiple items are selected, only the up-most selected item is returned.
Returns:
{sap.m.ListItemBase}
getSelectedItems(): sap.m.ListItemBase[]
Returns an array containing the selected list items. If no items are selected, an empty array is returned.
Returns:
{sap.m.ListItemBase[]}
getSelectionMode(): sap.m.ListMode
Gets current value of property selectionMode.

Selection Mode

Default value is MultiSelect.

Returns:
{sap.m.ListMode} Value of property selectionMode
indexOfItem(oItem): int
Checks for the provided sap.m.ListItemBase in the aggregation items. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.ListItemBase}oItem The item whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertItem(oItem, iIndex): sap.ui.vk.ListPanel
Inserts a item into the aggregation items.
Parameters:
{sap.m.ListItemBase}oItem the item to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
removeAllItems(): sap.m.ListItemBase[]
Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.m.ListItemBase[]} An array of the removed elements (might be empty)
removeItem(vItem): sap.m.ListItemBase
Removes a item from the aggregation items.
Parameters:
{int|string|sap.m.ListItemBase}vItem The itemto remove or its index or id
Returns:
{sap.m.ListItemBase} The removed item or null
setExpandAnimation(bExpandAnimation): sap.ui.vk.ListPanel
Sets a new value for property expandAnimation.

Expand animation

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

Default value is true.

Parameters:
{boolean}bExpandAnimation New value for property expandAnimation
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
setExpanded(bExpanded): sap.ui.vk.ListPanel
Sets a new value for property expanded.

Expansion state

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

Default value is true.

Parameters:
{boolean}bExpanded New value for property expanded
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
setHeaderIcon(sHeaderIcon): sap.ui.vk.ListPanel
Sets a new value for property headerIcon.

Header icon

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

Parameters:
{sap.ui.core.URI}sHeaderIcon New value for property headerIcon
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
setHeaderText(sHeaderText): sap.ui.vk.ListPanel
Sets a new value for property headerText.

Header text

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

Parameters:
{string}sHeaderText New value for property headerText
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining
setSelectedItem(oListItem, bSelect)
Selects or deselects the given list item.
Parameters:
{sap.m.ListItemBase}oListItem The list item whose selection to be changed. This parameter is mandatory.
{boolean}bSelect Sets selected status of the list item. Default value is true.
setSelectionMode(sSelectionMode): sap.ui.vk.ListPanel
Sets a new value for property selectionMode.

Selection Mode

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

Default value is MultiSelect.

Parameters:
{sap.m.ListMode}sSelectionMode New value for property selectionMode
Returns:
{sap.ui.vk.ListPanel} Reference to this in order to allow method chaining