Contains N sections, acting as containers for any library control
Constructor for a new Accordion.
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.commons.Accordion(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 |
---|---|---|---|
openedSectionsId | string | Section IDs that are opened by default at application start Visibility: public |
|
width | sap.ui.core.CSSSize | 200px | When the specified width is less than the width of a section content, a horizontal scroll bar is provided. Visibility: public |
Default Aggregation: sections
Name | Cardinality | Type | Description |
---|---|---|---|
sections (default) | 0..n | sap.ui.commons.AccordionSection |
Empty container used to display any library control |
Event | Description |
---|---|
sectionClose |
Event is triggered when the user closes a section. |
sectionOpen |
Event is triggered when the user opens a section. |
sectionsReorder |
Event is triggered when the user changes the position of a section. |
Event is triggered when the user closes a section.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
closeSectionId | string |
ID of the closed section |
Event is triggered when the user opens a section.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
openSectionId | string |
ID of the opened section |
closeSectionIds | string[] |
IDs of the sections to be closed. Can be initial in the case of no previously opened section. |
Method | Description |
---|---|
addSection |
Adds some section to the aggregation sections. |
attachSectionClose |
Attaches event handler When called, the context of the event handler (its Event is triggered when the user closes a section. |
attachSectionOpen |
Attaches event handler When called, the context of the event handler (its Event is triggered when the user opens a section. |
attachSectionsReorder |
Attaches event handler When called, the context of the event handler (its Event is triggered when the user changes the position of a section. |
closeSection |
Closes a section and opens the default one |
destroySections |
Destroys all the sections in the aggregation sections. |
detachSectionClose |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSectionOpen |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSectionsReorder |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.Accordion.extend |
Creates a new subclass of class sap.ui.commons.Accordion with name
|
fireSectionClose |
Fires event sectionClose to attached listeners. |
fireSectionOpen |
Fires event sectionOpen to attached listeners. |
fireSectionsReorder |
Fires event sectionsReorder to attached listeners. |
sap.ui.commons.Accordion.getMetadata |
Returns a metadata object for class sap.ui.commons.Accordion. |
getOpenedSectionsId |
Gets current value of property openedSectionsId. Section IDs that are opened by default at application start |
getSections |
Gets content of aggregation sections. Empty container used to display any library control |
getWidth |
Gets current value of property width. When the specified width is less than the width of a section content, a horizontal scroll bar is provided. Default value is |
indexOfSection |
Checks for the provided |
insertSection |
Inserts a section into the aggregation sections. |
openSection |
Opens a section |
removeAllSections |
Removes all the controls from the aggregation sections. Additionally, it unregisters them from the hosting UIArea. |
removeSection |
Removes a section from the aggregation sections. |
setOpenedSectionsId |
Redefinition of the method to add additional handling |
setWidth |
Sets a new value for property width. When the specified width is less than the width of a section content, a horizontal scroll bar is provided. When called with a value of Default value is |
Adds some section to the aggregation sections.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSection | sap.ui.commons.AccordionSection |
The section to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the sectionClose event of this sap.ui.commons.Accordion
.
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.commons.Accordion
itself.
Event is triggered when the user closes a section.
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 sectionOpen event of this sap.ui.commons.Accordion
.
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.commons.Accordion
itself.
Event is triggered when the user opens a section.
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 sectionsReorder event of this sap.ui.commons.Accordion
.
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.commons.Accordion
itself.
Event is triggered when the user changes the position of a section.
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 |
Closes a section and opens the default one
Param | Type | DefaultValue | Description |
---|---|---|---|
sSectionId | string |
Id of the section that is being closed |
Detaches event handler fnFunction
from the sectionClose event of this sap.ui.commons.Accordion
.
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 sectionOpen event of this sap.ui.commons.Accordion
.
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 sectionsReorder event of this sap.ui.commons.Accordion
.
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.commons.Accordion 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.
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 sectionClose to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
closeSectionId | string |
ID of the closed section |
Fires event sectionOpen to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
openSectionId | string |
ID of the opened section |
|
closeSectionIds | string[] |
IDs of the sections to be closed. Can be initial in the case of no previously opened section. |
Fires event sectionsReorder to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
movedSectionId | string |
ID of the moved section |
|
newIndex | int |
New index of the moved section |
Gets current value of property openedSectionsId.
Section IDs that are opened by default at application start
Gets content of aggregation sections.
Empty container used to display any library control
Gets current value of property width.
When the specified width is less than the width of a section content, a horizontal scroll bar is provided.
Default value is '200px'
.
Checks for the provided sap.ui.commons.AccordionSection
in the aggregation sections. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSection | sap.ui.commons.AccordionSection |
The section whose index is looked for |
Inserts a section into the aggregation sections.
Param | Type | DefaultValue | Description |
---|---|---|---|
oSection | sap.ui.commons.AccordionSection |
The section to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Opens a section
Param | Type | DefaultValue | Description |
---|---|---|---|
sSectionId | string |
Id of the section that is being opened |
Removes all the controls from the aggregation sections.
Additionally, it unregisters them from the hosting UIArea.
Removes a section from the aggregation sections.
Param | Type | DefaultValue | Description |
---|---|---|---|
vSection | int string sap.ui.commons.AccordionSection |
The section to remove or its index or id |
Redefinition of the method to add additional handling
Param | Type | DefaultValue | Description |
---|---|---|---|
sOpenedSectionsId | string |
New value for property openedSectionsId |
Sets a new value for property width.
When the specified width is less than the width of a section content, a horizontal scroll bar is provided.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is '200px'
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize | '200px' |
New value for property |