class sap.ui.unified.calendar.Header

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

renders a calendar header

The calendar header consists of 3 buttons where the text can be set and a previous and a next button. In the normal calendar the first button contains the displayed day, the second button the displayed month and the third button the displayed year.

Note: This is used inside the calendar. Not for standalone usage


Constructor

Constructor for a new Header.

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.unified.calendar.Header(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
additionalTextButton0 string

Additional text of the first button (normally day)

Since: 1.34.0.

Visibility: public
additionalTextButton1 string

Additional text of the second button (normally month)

Since: 1.34.0.

Visibility: public
additionalTextButton2 string

Additional text of the third button (normally year)

Since: 1.34.0.

Visibility: public
ariaLabelButton0 string

aria-label of the first button (normally day)

Since: 1.32.0.

Visibility: public
ariaLabelButton1 string

aria-label of the second button (normally month)

Visibility: public
ariaLabelButton2 string

aria-label of the third button (normally year)

Visibility: public
enabledNext boolean true

Enables the Next button

Visibility: public
enabledPrevious boolean true

Enables the previous button

Visibility: public
textButton0 string

Text of the first button (normally day)

Since: 1.32.0.

Visibility: public
textButton1 string

Text of the second button (normally month)

Visibility: public
textButton2 string

Text of the third button (normally year)

Visibility: public
visibleButton0 boolean false

If set, the first button will be displayed

Note: The default is set to false to be compatible to older versions

Since: 1.32.0.

Visibility: public
visibleButton1 boolean true

If set, the second button will be displayed

Since: 1.32.0.

Visibility: public
visibleButton2 boolean true

If set, the third button will be displayed

Since: 1.32.0.

Visibility: public
visibleCurrentDateButton boolean false

If set, the Current date button will be displayed.

Since: 1.95.0.

Visibility: public

Events Overview

Event Description
pressButton0

First button pressed (normally day)

Since: 1.32.0.

pressButton1

Second button pressed (normally month)

pressButton2

Third button pressed (normally year)

pressCurrentDate

Current date button pressed

pressNext

Next button pressed

pressPrevious

Previous button pressed

pressButton0

First button pressed (normally day)

Since: 1.32.0.

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

pressButton1

Second button pressed (normally month)

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

pressButton2

Third button pressed (normally year)

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

pressCurrentDate

Current date button pressed

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

pressNext

Next button pressed

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

pressPrevious

Previous button pressed

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

Methods Overview

Method Description
attachPressButton0

Attaches event handler fnFunction to the pressButton0 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

First button pressed (normally day)

attachPressButton1

Attaches event handler fnFunction to the pressButton1 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Second button pressed (normally month)

attachPressButton2

Attaches event handler fnFunction to the pressButton2 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Third button pressed (normally year)

attachPressCurrentDate

Attaches event handler fnFunction to the pressCurrentDate event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Current date button pressed

attachPressNext

Attaches event handler fnFunction to the pressNext event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Next button pressed

attachPressPrevious

Attaches event handler fnFunction to the pressPrevious event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Previous button pressed

detachPressButton0

Detaches event handler fnFunction from the pressButton0 event of this sap.ui.unified.calendar.Header.

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

detachPressButton1

Detaches event handler fnFunction from the pressButton1 event of this sap.ui.unified.calendar.Header.

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

detachPressButton2

Detaches event handler fnFunction from the pressButton2 event of this sap.ui.unified.calendar.Header.

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

detachPressCurrentDate

Detaches event handler fnFunction from the pressCurrentDate event of this sap.ui.unified.calendar.Header.

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

detachPressNext

Detaches event handler fnFunction from the pressNext event of this sap.ui.unified.calendar.Header.

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

detachPressPrevious

Detaches event handler fnFunction from the pressPrevious event of this sap.ui.unified.calendar.Header.

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

sap.ui.unified.calendar.Header.extend

Creates a new subclass of class sap.ui.unified.calendar.Header 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.

firePressButton0

Fires event pressButton0 to attached listeners.

firePressButton1

Fires event pressButton1 to attached listeners.

firePressButton2

Fires event pressButton2 to attached listeners.

firePressCurrentDate

Fires event pressCurrentDate to attached listeners.

firePressNext

Fires event pressNext to attached listeners.

firePressPrevious

Fires event pressPrevious to attached listeners.

getAdditionalTextButton0

Gets current value of property additionalTextButton0.

Additional text of the first button (normally day)

getAdditionalTextButton1

Gets current value of property additionalTextButton1.

Additional text of the second button (normally month)

getAdditionalTextButton2

Gets current value of property additionalTextButton2.

Additional text of the third button (normally year)

getAriaLabelButton0

Gets current value of property ariaLabelButton0.

aria-label of the first button (normally day)

getAriaLabelButton1

Gets current value of property ariaLabelButton1.

aria-label of the second button (normally month)

getAriaLabelButton2

Gets current value of property ariaLabelButton2.

aria-label of the third button (normally year)

getEnabledNext

Gets current value of property enabledNext.

Enables the Next button

Default value is true.

getEnabledPrevious

Gets current value of property enabledPrevious.

Enables the previous button

Default value is true.

sap.ui.unified.calendar.Header.getMetadata

Returns a metadata object for class sap.ui.unified.calendar.Header.

getTextButton0

Gets current value of property textButton0.

Text of the first button (normally day)

getTextButton1

Gets current value of property textButton1.

Text of the second button (normally month)

getTextButton2

Gets current value of property textButton2.

Text of the third button (normally year)

getVisibleButton0

Gets current value of property visibleButton0.

If set, the first button will be displayed

Note: The default is set to false to be compatible to older versions

Default value is false.

getVisibleButton1

Gets current value of property visibleButton1.

If set, the second button will be displayed

Default value is true.

getVisibleButton2

Gets current value of property visibleButton2.

If set, the third button will be displayed

Default value is true.

getVisibleCurrentDateButton

Gets current value of property visibleCurrentDateButton.

If set, the Current date button will be displayed.

Default value is false.

setAdditionalTextButton0

Sets a new value for property additionalTextButton0.

Additional text of the first button (normally day)

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

setAdditionalTextButton1

Sets a new value for property additionalTextButton1.

Additional text of the second button (normally month)

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

setAdditionalTextButton2

Sets a new value for property additionalTextButton2.

Additional text of the third button (normally year)

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

setAriaLabelButton0

Sets a new value for property ariaLabelButton0.

aria-label of the first button (normally day)

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

setAriaLabelButton1

Sets a new value for property ariaLabelButton1.

aria-label of the second button (normally month)

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

setAriaLabelButton2

Sets a new value for property ariaLabelButton2.

aria-label of the third button (normally year)

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

setEnabledNext

Sets a new value for property enabledNext.

Enables the Next button

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

Default value is true.

setEnabledPrevious

Sets a new value for property enabledPrevious.

Enables the previous button

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

Default value is true.

setTextButton0

Sets a new value for property textButton0.

Text of the first button (normally day)

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

setTextButton1

Sets a new value for property textButton1.

Text of the second button (normally month)

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

setTextButton2

Sets a new value for property textButton2.

Text of the third button (normally year)

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

setVisibleButton0

Sets a new value for property visibleButton0.

If set, the first button will be displayed

Note: The default is set to false to be compatible to older versions

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

Default value is false.

setVisibleButton1

Sets a new value for property visibleButton1.

If set, the second button will be displayed

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

Default value is true.

setVisibleButton2

Sets a new value for property visibleButton2.

If set, the third button will be displayed

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

Default value is true.

setVisibleCurrentDateButton

Sets a new value for property visibleCurrentDateButton.

If set, the Current date button will be displayed.

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

Default value is false.

attachPressButton0

Attaches event handler fnFunction to the pressButton0 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

First button pressed (normally day)

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.unified.calendar.Header itself

attachPressButton1

Attaches event handler fnFunction to the pressButton1 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Second button pressed (normally month)

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.unified.calendar.Header itself

attachPressButton2

Attaches event handler fnFunction to the pressButton2 event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Third button pressed (normally year)

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.unified.calendar.Header itself

attachPressCurrentDate

Attaches event handler fnFunction to the pressCurrentDate event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Current date button pressed

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.unified.calendar.Header itself

attachPressNext

Attaches event handler fnFunction to the pressNext event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Next button pressed

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.unified.calendar.Header itself

attachPressPrevious

Attaches event handler fnFunction to the pressPrevious event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header itself.

Previous button pressed

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.unified.calendar.Header itself

detachPressButton0

Detaches event handler fnFunction from the pressButton0 event of this sap.ui.unified.calendar.Header.

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

detachPressButton1

Detaches event handler fnFunction from the pressButton1 event of this sap.ui.unified.calendar.Header.

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

detachPressButton2

Detaches event handler fnFunction from the pressButton2 event of this sap.ui.unified.calendar.Header.

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

detachPressCurrentDate

Detaches event handler fnFunction from the pressCurrentDate event of this sap.ui.unified.calendar.Header.

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

detachPressNext

Detaches event handler fnFunction from the pressNext event of this sap.ui.unified.calendar.Header.

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

detachPressPrevious

Detaches event handler fnFunction from the pressPrevious event of this sap.ui.unified.calendar.Header.

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.unified.calendar.Header.extend

Creates a new subclass of class sap.ui.unified.calendar.Header 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

firePressButton0

Fires event pressButton0 to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePressButton1

Fires event pressButton1 to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePressButton2

Fires event pressButton2 to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePressCurrentDate

Fires event pressCurrentDate to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePressNext

Fires event pressNext to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

firePressPrevious

Fires event pressPrevious to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAdditionalTextButton0

Gets current value of property additionalTextButton0.

Additional text of the first button (normally day)

getAdditionalTextButton1

Gets current value of property additionalTextButton1.

Additional text of the second button (normally month)

getAdditionalTextButton2

Gets current value of property additionalTextButton2.

Additional text of the third button (normally year)

getAriaLabelButton0

Gets current value of property ariaLabelButton0.

aria-label of the first button (normally day)

getAriaLabelButton1

Gets current value of property ariaLabelButton1.

aria-label of the second button (normally month)

getAriaLabelButton2

Gets current value of property ariaLabelButton2.

aria-label of the third button (normally year)

getEnabledNext

Gets current value of property enabledNext.

Enables the Next button

Default value is true.

getEnabledPrevious

Gets current value of property enabledPrevious.

Enables the previous button

Default value is true.

sap.ui.unified.calendar.Header.getMetadata

Returns a metadata object for class sap.ui.unified.calendar.Header.

getTextButton0

Gets current value of property textButton0.

Text of the first button (normally day)

getTextButton1

Gets current value of property textButton1.

Text of the second button (normally month)

getTextButton2

Gets current value of property textButton2.

Text of the third button (normally year)

getVisibleButton0

Gets current value of property visibleButton0.

If set, the first button will be displayed

Note: The default is set to false to be compatible to older versions

Default value is false.

getVisibleButton1

Gets current value of property visibleButton1.

If set, the second button will be displayed

Default value is true.

getVisibleButton2

Gets current value of property visibleButton2.

If set, the third button will be displayed

Default value is true.

getVisibleCurrentDateButton

Gets current value of property visibleCurrentDateButton.

If set, the Current date button will be displayed.

Default value is false.

setAdditionalTextButton0

Sets a new value for property additionalTextButton0.

Additional text of the first button (normally day)

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

Param Type DefaultValue Description
sAdditionalTextButton0 string

New value for property additionalTextButton0

setAdditionalTextButton1

Sets a new value for property additionalTextButton1.

Additional text of the second button (normally month)

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

Param Type DefaultValue Description
sAdditionalTextButton1 string

New value for property additionalTextButton1

setAdditionalTextButton2

Sets a new value for property additionalTextButton2.

Additional text of the third button (normally year)

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

Param Type DefaultValue Description
sAdditionalTextButton2 string

New value for property additionalTextButton2

setAriaLabelButton0

Sets a new value for property ariaLabelButton0.

aria-label of the first button (normally day)

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

Param Type DefaultValue Description
sAriaLabelButton0 string

New value for property ariaLabelButton0

setAriaLabelButton1

Sets a new value for property ariaLabelButton1.

aria-label of the second button (normally month)

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

Param Type DefaultValue Description
sAriaLabelButton1 string

New value for property ariaLabelButton1

setAriaLabelButton2

Sets a new value for property ariaLabelButton2.

aria-label of the third button (normally year)

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

Param Type DefaultValue Description
sAriaLabelButton2 string

New value for property ariaLabelButton2

setEnabledNext

Sets a new value for property enabledNext.

Enables the Next button

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

Default value is true.

Param Type DefaultValue Description
bEnabledNext boolean true

New value for property enabledNext

setEnabledPrevious

Sets a new value for property enabledPrevious.

Enables the previous button

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

Default value is true.

Param Type DefaultValue Description
bEnabledPrevious boolean true

New value for property enabledPrevious

setTextButton0

Sets a new value for property textButton0.

Text of the first button (normally day)

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

Param Type DefaultValue Description
sTextButton0 string

New value for property textButton0

setTextButton1

Sets a new value for property textButton1.

Text of the second button (normally month)

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

Param Type DefaultValue Description
sTextButton1 string

New value for property textButton1

setTextButton2

Sets a new value for property textButton2.

Text of the third button (normally year)

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

Param Type DefaultValue Description
sTextButton2 string

New value for property textButton2

setVisibleButton0

Sets a new value for property visibleButton0.

If set, the first button will be displayed

Note: The default is set to false to be compatible to older versions

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
bVisibleButton0 boolean false

New value for property visibleButton0

setVisibleButton1

Sets a new value for property visibleButton1.

If set, the second button will be displayed

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

Default value is true.

Param Type DefaultValue Description
bVisibleButton1 boolean true

New value for property visibleButton1

setVisibleButton2

Sets a new value for property visibleButton2.

If set, the third button will be displayed

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

Default value is true.

Param Type DefaultValue Description
bVisibleButton2 boolean true

New value for property visibleButton2

setVisibleCurrentDateButton

Sets a new value for property visibleCurrentDateButton.

If set, the Current date button will be displayed.

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
bVisibleCurrentDateButton boolean false

New value for property visibleCurrentDateButton