class sap.ui.commons.Accordion

Control sample: sap.ui.commons.Accordion
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/commons/Accordion
Application Component: CA-UI5-CTR

Contains N sections, acting as containers for any library control


Constructor

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


Properties

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

Aggregations

Default Aggregation: sections

Name Cardinality Type Description
sections (default) 0..n sap.ui.commons.AccordionSection

Empty container used to display any library control


Events Overview

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.

sectionClose

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

sectionOpen

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.

sectionsReorder

Event is triggered when the user changes the position of a section.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
movedSectionId string

ID of the moved section

newIndex int

New index of the moved section


Methods Overview

Method Description
addSection

Adds some section to the aggregation sections.

attachSectionClose

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.

attachSectionOpen

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.

attachSectionsReorder

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.

closeSection

Closes a section and opens the default one

destroySections

Destroys all the sections in the aggregation sections.

detachSectionClose

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.

detachSectionOpen

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.

detachSectionsReorder

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.

sap.ui.commons.Accordion.extend

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.

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 '200px'.

indexOfSection

Checks for the provided sap.ui.commons.AccordionSection in the aggregation sections. and returns its index if found or -1 otherwise.

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 null or undefined, the default value of the property will be restored.

Default value is '200px'.

addSection

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

attachSectionClose

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 sap.ui.commons.Accordion itself

attachSectionOpen

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 sap.ui.commons.Accordion itself

attachSectionsReorder

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 sap.ui.commons.Accordion itself

closeSection

Closes a section and opens the default one

Param Type DefaultValue Description
sSectionId string

Id of the section that is being closed

destroySections

Destroys all the sections in the aggregation sections.

detachSectionClose

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

detachSectionOpen

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

detachSectionsReorder

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

sap.ui.commons.Accordion.extend

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

fireSectionClose

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

fireSectionOpen

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.

fireSectionsReorder

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

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 '200px'.

indexOfSection

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

insertSection

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 0-based index the section should be inserted at; for a negative value of iIndex, the section is inserted at position 0; for a value greater than the current size of the aggregation, the section is inserted at the last position

openSection

Opens a section

Param Type DefaultValue Description
sSectionId string

Id of the section that is being opened

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.

Param Type DefaultValue Description
vSection int string sap.ui.commons.AccordionSection

The section to remove or its index or id

setOpenedSectionsId

Redefinition of the method to add additional handling

Param Type DefaultValue Description
sOpenedSectionsId string

New value for property openedSectionsId

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 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 width