class sap.m.ColorPalettePopover

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

A thin wrapper over sap.m.ColorPalette allowing the latter to be used in a popover.


Constructor

Constructor for a new ColorPalettePopover.

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.m.ColorPalettePopover(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
colors sap.ui.core.CSSColor[] gold, darkorange, indianred, darkmagenta, cornflowerblue, deepskyblue, darkcyan, olivedrab, darkslategray, azure, white, lightgray, darkgray, dimgray, black

Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.

Visibility: public
defaultColor sap.ui.core.CSSColor

The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.

Visibility: public
displayMode sap.ui.unified.ColorPickerDisplayMode Default

Determines the displayMode of the ColorPicker among three types - Default, Large and Simplified

Since: 1.70.

Visibility: public
showDefaultColorButton boolean true

Indicates if the button for default color selection is available.

Visibility: public
showMoreColorsButton boolean true

Denotes if the color has been chosen by selecting the "Default Color" button (true or false)

Visibility: public
showRecentColorsSection boolean true

Indicates if the Recent Colors section is available

Since: 1.74.

Visibility: public

Events Overview

Event Description
colorSelect

Fired when the user selects a color.

liveChange

Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette

Since: 1.85.

colorSelect

Fired when the user selects a color.

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

The color that is returned when user chooses the "Default Color" button.

defaultAction boolean

Denotes if the color has been chosen by selecting the "Default Color" button (true or false).

liveChange

Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette

Since: 1.85.

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

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).


Methods Overview

Method Description
attachColorSelect

Attaches event handler fnFunction to the colorSelect event of this sap.m.ColorPalettePopover.

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.m.ColorPalettePopover itself.

Fired when the user selects a color.

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.m.ColorPalettePopover.

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.m.ColorPalettePopover itself.

Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette

close

Closes the ColorPalettePopover.

detachColorSelect

Detaches event handler fnFunction from the colorSelect event of this sap.m.ColorPalettePopover.

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

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.m.ColorPalettePopover.

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

sap.m.ColorPalettePopover.extend

Creates a new subclass of class sap.m.ColorPalettePopover 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.

fireColorSelect

Fires event colorSelect to attached listeners.

fireLiveChange

Fires event liveChange to attached listeners.

getColors

Gets current value of property colors.

Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.

Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"].

getDefaultColor

Gets current value of property defaultColor.

The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.

getDisplayMode

Gets current value of property displayMode.

Determines the displayMode of the ColorPicker among three types - Default, Large and Simplified

Default value is Default.

sap.m.ColorPalettePopover.getMetadata

Returns a metadata object for class sap.m.ColorPalettePopover.

getShowDefaultColorButton

Gets current value of property showDefaultColorButton.

Indicates if the button for default color selection is available.

Default value is true.

getShowMoreColorsButton

Gets current value of property showMoreColorsButton.

Denotes if the color has been chosen by selecting the "Default Color" button (true or false)

Default value is true.

getShowRecentColorsSection

Gets current value of property showRecentColorsSection.

Indicates if the Recent Colors section is available

Default value is true.

setColorPickerSelectedColor

Sets a selected color for the ColorPicker control.

setColors

Sets a new value for property colors.

Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.

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

Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"].

setDefaultColor

Sets a new value for property defaultColor.

The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.

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

setDisplayMode

Sets a new value for property displayMode.

Determines the displayMode of the ColorPicker among three types - Default, Large and Simplified

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

Default value is Default.

setShowDefaultColorButton

Sets a new value for property showDefaultColorButton.

Indicates if the button for default color selection is available.

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

Default value is true.

setShowMoreColorsButton

Sets a new value for property showMoreColorsButton.

Denotes if the color has been chosen by selecting the "Default Color" button (true or false)

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

Default value is true.

setShowRecentColorsSection

Sets a new value for property showRecentColorsSection.

Indicates if the Recent Colors section is available

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

Default value is true.

attachColorSelect

Attaches event handler fnFunction to the colorSelect event of this sap.m.ColorPalettePopover.

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.m.ColorPalettePopover itself.

Fired when the user selects a color.

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.m.ColorPalettePopover itself

attachLiveChange

Attaches event handler fnFunction to the liveChange event of this sap.m.ColorPalettePopover.

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.m.ColorPalettePopover itself.

Fired when the value is changed by user interaction in the internal ColorPicker of the ColorPalette

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.m.ColorPalettePopover itself

close

Closes the ColorPalettePopover.

detachColorSelect

Detaches event handler fnFunction from the colorSelect event of this sap.m.ColorPalettePopover.

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

detachLiveChange

Detaches event handler fnFunction from the liveChange event of this sap.m.ColorPalettePopover.

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.m.ColorPalettePopover.extend

Creates a new subclass of class sap.m.ColorPalettePopover 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

fireColorSelect

Fires event colorSelect to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

value sap.ui.core.CSSColor

The color that is returned when user chooses the "Default Color" button.

defaultAction boolean

Denotes if the color has been chosen by selecting the "Default Color" button (true or false).

fireLiveChange

Fires event liveChange to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

r int

Parameter containing the RED value (0-255).

g int

Parameter containing the GREEN value (0-255).

b int

Parameter containing the BLUE value (0-255).

h int

Parameter containing the HUE value (0-360).

s int

Parameter containing the SATURATION value (0-100).

v int

Parameter containing the VALUE value (0-100).

l int

Parameter containing the LIGHTNESS value (0-100).

hex string

Parameter containing the Hexadecimal string (#FFFFFF).

alpha string

Parameter containing the alpha value (transparency).

getColors

Gets current value of property colors.

Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.

Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"].

getDefaultColor

Gets current value of property defaultColor.

The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.

getDisplayMode

Gets current value of property displayMode.

Determines the displayMode of the ColorPicker among three types - Default, Large and Simplified

Default value is Default.

sap.m.ColorPalettePopover.getMetadata

Returns a metadata object for class sap.m.ColorPalettePopover.

getShowDefaultColorButton

Gets current value of property showDefaultColorButton.

Indicates if the button for default color selection is available.

Default value is true.

getShowMoreColorsButton

Gets current value of property showMoreColorsButton.

Denotes if the color has been chosen by selecting the "Default Color" button (true or false)

Default value is true.

getShowRecentColorsSection

Gets current value of property showRecentColorsSection.

Indicates if the Recent Colors section is available

Default value is true.

setColorPickerSelectedColor

Sets a selected color for the ColorPicker control.

Param Type DefaultValue Description
color sap.ui.core.CSSColor

the selected color

setColors

Sets a new value for property colors.

Defines the List of colors displayed in the palette. Minimum is 2 colors, maximum is 15 colors.

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

Default value is ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"].

Param Type DefaultValue Description
sColors sap.ui.core.CSSColor[] ["gold", "darkorange", "indianred", "darkmagenta", "cornflowerblue", "deepskyblue", "darkcyan", "olivedrab", "darkslategray", "azure", "white", "lightgray", "darkgray", "dimgray", "black"]

New value for property colors

setDefaultColor

Sets a new value for property defaultColor.

The color, which the app developer will receive when end-user chooses the "Default color" button. See event colorSelect.

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

Param Type DefaultValue Description
sDefaultColor sap.ui.core.CSSColor

New value for property defaultColor

setDisplayMode

Sets a new value for property displayMode.

Determines the displayMode of the ColorPicker among three types - Default, Large and Simplified

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

Default value is Default.

Param Type DefaultValue Description
sDisplayMode sap.ui.unified.ColorPickerDisplayMode Default

New value for property displayMode

setShowDefaultColorButton

Sets a new value for property showDefaultColorButton.

Indicates if the button for default color selection is available.

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
bShowDefaultColorButton boolean true

New value for property showDefaultColorButton

setShowMoreColorsButton

Sets a new value for property showMoreColorsButton.

Denotes if the color has been chosen by selecting the "Default Color" button (true or false)

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
bShowMoreColorsButton boolean true

New value for property showMoreColorsButton

setShowRecentColorsSection

Sets a new value for property showRecentColorsSection.

Indicates if the Recent Colors section is available

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
bShowRecentColorsSection boolean true

New value for property showRecentColorsSection