Collection
Constructor for a new Collection.
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.ui.ux3.Collection(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 |
Name | Type | Default Value | Description |
---|---|---|---|
editable | boolean | false | If a collection is editable an edit button will be displayed below the list of items Visibility: public |
multiSelection | boolean | false | Allow multi selection of items in collection Visibility: public |
title | string | Name for the collection Visibility: public |
Default Aggregation:
Name | Cardinality | Type | Description |
---|---|---|---|
items | 0..n | sap.ui.core.Item |
Items in the collection |
Name | Cardinality | Type | Description |
---|---|---|---|
selectedItems | 0..n | sap.ui.core.Item |
Contains all items that are currently selected |
Event | Description |
---|---|
propertyChanged |
Fires if a property has changed, and the collection inspector needs to do something after that |
selectionChanged |
Fired when ever the selected items changer |
Method | Description |
---|---|
addItem |
Adds some item to the aggregation items. |
addSelectedItem | |
attachPropertyChanged |
Attaches event handler When called, the context of the event handler (its Fires if a property has changed, and the collection inspector needs to do something after that |
attachSelectionChanged |
Attaches event handler When called, the context of the event handler (its Fired when ever the selected items changer |
destroyItems |
Destroys all the items in the aggregation items. |
detachPropertyChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelectionChanged |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.ux3.Collection.extend |
Creates a new subclass of class sap.ui.ux3.Collection with name
|
firePropertyChanged |
Fires event propertyChanged to attached listeners. |
fireSelectionChanged |
Fires event selectionChanged to attached listeners. |
getEditable |
Gets current value of property editable. If a collection is editable an edit button will be displayed below the list of items Default value is |
getItems |
Gets content of aggregation items. Items in the collection |
sap.ui.ux3.Collection.getMetadata |
Returns a metadata object for class sap.ui.ux3.Collection. |
getMultiSelection |
Gets current value of property multiSelection. Allow multi selection of items in collection Default value is |
getSelectedItems |
Returns array of IDs of the elements which are the current targets of the association selectedItems. |
getTitle |
Gets current value of property title. Name for the collection |
indexOfItem |
Checks for the provided |
insertItem |
Inserts a item into the aggregation items. |
removeAllItems |
Removes all the controls from the aggregation items. Additionally, it unregisters them from the hosting UIArea. |
removeAllSelectedItems | |
removeItem |
Removes a item from the aggregation items. |
removeSelectedItem | |
setEditable |
Sets a new value for property editable. If a collection is editable an edit button will be displayed below the list of items When called with a value of Default value is |
setMultiSelection |
Sets a new value for property multiSelection. Allow multi selection of items in collection When called with a value of Default value is |
setTitle |
Sets a new value for property title. Name for the collection When called with a value of |
Adds some item to the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to add; if empty, nothing is inserted |
Param | Type | DefaultValue | Description |
---|---|---|---|
vSelectedItem | string sap.ui.core.Item |
Id of a selectedItem which becomes an additional target of this |
Attaches event handler fnFunction
to the propertyChanged event of this sap.ui.ux3.Collection
.
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.ux3.Collection
itself.
Fires if a property has changed, and the collection inspector needs to do something after that
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 |
Attaches event handler fnFunction
to the selectionChanged event of this sap.ui.ux3.Collection
.
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.ux3.Collection
itself.
Fired when ever the selected items changer
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 |
Detaches event handler fnFunction
from the propertyChanged event of this sap.ui.ux3.Collection
.
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 |
Detaches event handler fnFunction
from the selectionChanged event of this sap.ui.ux3.Collection
.
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 |
Creates a new subclass of class sap.ui.ux3.Collection 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.Element.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 |
Fires event propertyChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event selectionChanged to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Gets current value of property editable.
If a collection is editable an edit button will be displayed below the list of items
Default value is false
.
Gets current value of property multiSelection.
Allow multi selection of items in collection
Default value is false
.
Returns array of IDs of the elements which are the current targets of the association selectedItems.
Checks for the provided sap.ui.core.Item
in the aggregation items. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item whose index is looked for |
Inserts a item into the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation items.
Additionally, it unregisters them from the hosting UIArea.
Removes a item from the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | int string sap.ui.core.Item |
The item to remove or its index or id |
Param | Type | DefaultValue | Description |
---|---|---|---|
vSelectedItem | int string sap.ui.core.Item |
the selectedItem to remove or its index or id |
Sets a new value for property editable.
If a collection is editable an edit button will be displayed below the list of items
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 |
---|---|---|---|
bEditable | boolean | false |
New value for property |
Sets a new value for property multiSelection.
Allow multi selection of items in collection
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 |
---|---|---|---|
bMultiSelection | boolean | false |
New value for property |
Sets a new value for property title.
Name for the collection
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sTitle | string |
New value for property |