class sap.ui.commons.AccordionSection

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

Represents a panel which is a container for other controls. The container does not have any layout function.


Constructor

Constructor for a new AccordionSection.

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.AccordionSection(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
collapsed boolean false

It is recommended to adjust the settings for the width when the section is set to 'collapsed'.

Visibility: public
enabled boolean true

It is required that the used theme supports the control.

Visibility: public
maxHeight sap.ui.core.CSSSize

When the section content exceeds maxHeight, a vertical scroll bar appears.

Visibility: public
title string

Text for the section header

Visibility: public

Aggregations

Default Aggregation: content

Name Cardinality Type Description
content (default) 0..n sap.ui.core.Control

Aggregates the controls that are contained in the panel. The control layout is browser-dependent. For a stable content layout, use a layout control as direct single child. When the panel dimensions are set, the child control may have width and height of 100%; when the panel dimensions are not set, the child defines the panel size.


Events Overview

Event Description
scroll

Event is fired when the user scrolls the panel

scroll

Event is fired when the user scrolls the panel

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
left int

Horizontal scroll position

top int

Vertical scroll position


Methods Overview

Method Description
addContent

Adds some content to the aggregation content.

attachScroll

Attaches event handler fnFunction to the scroll event of this sap.ui.commons.AccordionSection.

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

Event is fired when the user scrolls the panel

destroyContent

Destroys all the content in the aggregation content.

detachScroll

Detaches event handler fnFunction from the scroll event of this sap.ui.commons.AccordionSection.

The passed function and listener object must match the ones used for event registration.

sap.ui.commons.AccordionSection.extend

Creates a new subclass of class sap.ui.commons.AccordionSection 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.

fireScroll

Fires event scroll to attached listeners.

getCollapsed

Gets current value of property collapsed.

It is recommended to adjust the settings for the width when the section is set to 'collapsed'.

Default value is false.

Since 1.34 Use Accordion's "openedSectionsId" property
getContent

Gets content of aggregation content.

Aggregates the controls that are contained in the panel. The control layout is browser-dependent. For a stable content layout, use a layout control as direct single child. When the panel dimensions are set, the child control may have width and height of 100%; when the panel dimensions are not set, the child defines the panel size.

getEnabled

Gets current value of property enabled.

It is required that the used theme supports the control.

Default value is true.

getMaxHeight

Gets current value of property maxHeight.

When the section content exceeds maxHeight, a vertical scroll bar appears.

sap.ui.commons.AccordionSection.getMetadata

Returns a metadata object for class sap.ui.commons.AccordionSection.

getTitle

Gets current value of property title.

Text for the section header

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

insertContent

Inserts a content into the aggregation content.

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeContent

Removes a content from the aggregation content.

setCollapsed

Property setter for the "collapsed" state

setEnabled

Property setter for the "enabled" state

setMaxHeight

Sets a new value for property maxHeight.

When the section content exceeds maxHeight, a vertical scroll bar appears.

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

setTitle

Sets a new value for property title.

Text for the section header

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

addContent

Adds some content to the aggregation content.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content to add; if empty, nothing is inserted

attachScroll

Attaches event handler fnFunction to the scroll event of this sap.ui.commons.AccordionSection.

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

Event is fired when the user scrolls the panel

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

destroyContent

Destroys all the content in the aggregation content.

detachScroll

Detaches event handler fnFunction from the scroll event of this sap.ui.commons.AccordionSection.

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.AccordionSection.extend

Creates a new subclass of class sap.ui.commons.AccordionSection 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

fireScroll

Fires event scroll to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

left int

Horizontal scroll position

top int

Vertical scroll position

getCollapsed

Gets current value of property collapsed.

It is recommended to adjust the settings for the width when the section is set to 'collapsed'.

Default value is false.

Since 1.34 Use Accordion's "openedSectionsId" property

getContent

Gets content of aggregation content.

Aggregates the controls that are contained in the panel. The control layout is browser-dependent. For a stable content layout, use a layout control as direct single child. When the panel dimensions are set, the child control may have width and height of 100%; when the panel dimensions are not set, the child defines the panel size.

getEnabled

Gets current value of property enabled.

It is required that the used theme supports the control.

Default value is true.

getMaxHeight

Gets current value of property maxHeight.

When the section content exceeds maxHeight, a vertical scroll bar appears.

sap.ui.commons.AccordionSection.getMetadata

Returns a metadata object for class sap.ui.commons.AccordionSection.

getTitle

Gets current value of property title.

Text for the section header

indexOfContent

Checks for the provided sap.ui.core.Control in the aggregation content. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content whose index is looked for

insertContent

Inserts a content into the aggregation content.

Param Type DefaultValue Description
oContent sap.ui.core.Control

The content to insert; if empty, nothing is inserted

iIndex int

The 0-based index the content should be inserted at; for a negative value of iIndex, the content is inserted at position 0; for a value greater than the current size of the aggregation, the content is inserted at the last position

removeAllContent

Removes all the controls from the aggregation content.

Additionally, it unregisters them from the hosting UIArea.

removeContent

Removes a content from the aggregation content.

Param Type DefaultValue Description
vContent int string sap.ui.core.Control

The content to remove or its index or id

setCollapsed

Property setter for the "collapsed" state

Param Type DefaultValue Description
bCollapsed boolean

Whether the AccordionSection is collapsed or not

setEnabled

Property setter for the "enabled" state

Param Type DefaultValue Description
bEnabled boolean

Whether the AccordionSection is enabled or not

setMaxHeight

Sets a new value for property maxHeight.

When the section content exceeds maxHeight, a vertical scroll bar appears.

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

Param Type DefaultValue Description
sMaxHeight sap.ui.core.CSSSize

New value for property maxHeight

setTitle

Sets a new value for property title.

Text for the section header

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 title