class sap.ui.comp.smartvariants.SmartVariantManagementUi2

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/smartvariants/SmartVariantManagementUi2
Application Component: CA-UI5-CMP

The SmartVariantManagementUi2 control is a specialization of the VariantManagement control and communicates with the Ui2 personalization layer to manage the variants. Note: The sap.ui.comp.smartvariants.SmartVariantManagementUi2 control does not support all the functionality of the sap.ui.comp.variants.VariantManagement control. Especially these properties are not supported:


Constructor

Constructor for a new SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2(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

Borrowed Properties

Name Type Default Value Description
defaultVariantKey string

Provides a string value to set the default variant. Used for the save dialog. Has no effect on the selected variant.

Since: 1.22.0.

Visibility: public
enabled boolean true

Can be set to true or false depending on whether you want to enable or disable the control.

Since: 1.22.0.

Visibility: public
inErrorState boolean false

Indicates that the control is in error state. If set to true error message will be displayed whenever the variant is opened.

Since: 1.52.0.

Visibility: public
initialSelectionKey string

Enables the setting of the initially selected variant.

Since: 1.22.0.

Visibility: public
lifecycleSupport boolean false

Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants.

Since: 1.26.0.

Visibility: public
selectionKey string

The key of the currently selected item. Returns null if the default item list is selected. This property is calculated when accessing it via the getSelectionKey method. The corresponding setSelectionKey method is not supported. The access via the standard set/getProperty is also not supported.

Since: 1.24.0.

Visibility: public
showCreateTile boolean false

Indicates that a Create Tile is visible in the Create dialog.

Since: 1.26.0.

Visibility: public
showExecuteOnSelection boolean false

Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs.

Since: 1.26.0.

Visibility: public
showSetAsDefault boolean true

Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs.

Since: 1.44.0.

Visibility: public
showShare boolean false

Indicates that the Public checkbox is visible in the Save View and the Manage Views dialogs. Selecting this checkbox allows you to share variants with other users.

Since: 1.26.0.

Visibility: public
standardItemAuthor string SAP

Defines the author of the standard variant, for example, the name of the own company.

Since: 1.86.

Visibility: public
standardItemText string

Overwrites the default Standard variant title.

Since: 1.28.0.

Visibility: public
useFavorites boolean false

Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list.

Since: 1.50.0.

Visibility: public
variantCreationByUserAllowed boolean true

Indicates that end users are allowed to create variants.

Since: 1.85.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
personalizableControl 0..1 sap.ui.comp.smartvariants.PersonalizableInfo

All controls that rely on variant handling have to be added to this aggregation. The only consumer currently known is the FilterBar control.

Borrowed Aggregations

Name Cardinality Type Description
items 0..n sap.ui.core.Item

Items displayed by the VariantManagement control.
Deprecated as of version 1.26.0. Replaced by association variantItems

variantItems 0..n sap.ui.comp.variants.VariantItem

Variant items displayed by the VariantManagement control.

Since: 1.26.0.


Events Overview

Event Description
afterSave

Fired after a variant is saved. This event can be used to retrieve the id of the saved variant.

initialise

Once the SmartVariantManagementUi2 control has been initialized, and especially after retrieving the variants via the UI2 personalization service, the registered consumer will be notified that this phase has completed

afterSave

Fired after a variant is saved. This event can be used to retrieve the id of the saved variant.

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

initialise

Once the SmartVariantManagementUi2 control has been initialized, and especially after retrieving the variants via the UI2 personalization service, the registered consumer will be notified that this phase has completed

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

Methods Overview

Method Description
addPersonalizableControl

Registers all controls interested and relying on variant handling. Each control has to be registered separately.

attachAfterSave

Attaches event handler fnFunction to the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2 itself.

Fired after a variant is saved. This event can be used to retrieve the id of the saved variant.

attachInitialise

Attaches event handler fnFunction to the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2 itself.

Once the SmartVariantManagementUi2 control has been initialized, and especially after retrieving the variants via the UI2 personalization service, the registered consumer will be notified that this phase has completed

destroyPersonalizableControl

Destroys the personalizableControl in the aggregation personalizableControl.

detachAfterSave

Detaches event handler fnFunction from the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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

detachInitialise

Detaches event handler fnFunction from the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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

sap.ui.comp.smartvariants.SmartVariantManagementUi2.extend

Creates a new subclass of class sap.ui.comp.smartvariants.SmartVariantManagementUi2 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.comp.variants.VariantManagement.extend.

fireAfterSave

Fires event afterSave to attached listeners.

fireInitialise

Fires event initialise to attached listeners.

getCurrentVariantId

Retrieves the current variant ID. For a standard variant, an empty string is returned.

sap.ui.comp.smartvariants.SmartVariantManagementUi2.getMetadata

Returns a metadata object for class sap.ui.comp.smartvariants.SmartVariantManagementUi2.

getPersonalizableControl

Gets content of aggregation personalizableControl.

All controls that rely on variant handling have to be added to this aggregation. The only consumer currently known is the FilterBar control.

getVariantContent

Retrieves the variant content.

initialise

Initializes the UI2 personalization layer by retrieving the list of variants. Once the initialization has been completed, the control for personalization is informed via the initialise event.

isPageVariant

Determines if the SmartVariantManagementUi3 instance is a page variant.

setCurrentVariantId

Sets the current variant ID. In case an invalid ID is passed, a standard variant is set.

setPersonalizableControl

Sets the aggregated personalizableControl.

addPersonalizableControl

Registers all controls interested and relying on variant handling. Each control has to be registered separately.

Param Type DefaultValue Description
oCurrentControlInfo sap.ui.comp.smartvariants.PersonalizableInfo

control providing the required aggregation for flex-layer

attachAfterSave

Attaches event handler fnFunction to the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2 itself.

Fired after a variant is saved. This event can be used to retrieve the id of the saved variant.

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.comp.smartvariants.SmartVariantManagementUi2 itself

attachInitialise

Attaches event handler fnFunction to the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2 itself.

Once the SmartVariantManagementUi2 control has been initialized, and especially after retrieving the variants via the UI2 personalization service, the registered consumer will be notified that this phase has completed

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.comp.smartvariants.SmartVariantManagementUi2 itself

destroyPersonalizableControl

Destroys the personalizableControl in the aggregation personalizableControl.

detachAfterSave

Detaches event handler fnFunction from the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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

detachInitialise

Detaches event handler fnFunction from the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.

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.comp.smartvariants.SmartVariantManagementUi2.extend

Creates a new subclass of class sap.ui.comp.smartvariants.SmartVariantManagementUi2 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.comp.variants.VariantManagement.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

fireAfterSave

Fires event afterSave to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

fireInitialise

Fires event initialise to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getCurrentVariantId

Retrieves the current variant ID. For a standard variant, an empty string is returned.

sap.ui.comp.smartvariants.SmartVariantManagementUi2.getMetadata

Returns a metadata object for class sap.ui.comp.smartvariants.SmartVariantManagementUi2.

getPersonalizableControl

Gets content of aggregation personalizableControl.

All controls that rely on variant handling have to be added to this aggregation. The only consumer currently known is the FilterBar control.

getVariantContent

Retrieves the variant content.

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

current control

sKey string

the variant key

initialise

Initializes the UI2 personalization layer by retrieving the list of variants. Once the initialization has been completed, the control for personalization is informed via the initialise event.

isPageVariant

Determines if the SmartVariantManagementUi3 instance is a page variant.

setCurrentVariantId

Sets the current variant ID. In case an invalid ID is passed, a standard variant is set.

Param Type DefaultValue Description
sVariantId string

ID of the variant

bDoNotApplyVariant boolean

If set to true, the applyVariant method is not executed yet. Relevant during navigation, when called before the initialise event has been executed

setPersonalizableControl

Sets the aggregated personalizableControl.

Param Type DefaultValue Description
oPersonalizableControl sap.ui.comp.smartvariants.PersonalizableInfo

The personalizableControl to set