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:
showExecuteOnSelection
showCreateTile
showShare
useFavorites
lifecycleSupport
inErrorState
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 |
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. |
|
enabled | boolean | true | Can be set to true or false depending on whether you want to enable or disable the control. |
inErrorState | boolean | false | Indicates that the control is in error state. If set to |
initialSelectionKey | string | Enables the setting of the initially selected variant. |
|
lifecycleSupport | boolean | false | Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants. |
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. |
|
showCreateTile | boolean | false | Indicates that a Create Tile is visible in the Create dialog. |
showExecuteOnSelection | boolean | false | Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs. |
showSetAsDefault | boolean | true | Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs. |
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. |
standardItemAuthor | string | SAP | Defines the author of the standard variant, for example, the name of the own company. |
standardItemText | string | Overwrites the default Standard variant title. |
|
useFavorites | boolean | false | Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list. |
variantCreationByUserAllowed | boolean | true | Indicates that end users are allowed to create variants. |
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 |
Name | Cardinality | Type | Description |
---|---|---|---|
items | 0..n | sap.ui.core.Item |
Items displayed by the |
variantItems | 0..n | sap.ui.comp.variants.VariantItem |
Variant items displayed by the |
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 |
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 |
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 |
Method | Description |
---|---|
addPersonalizableControl |
Registers all controls interested and relying on variant handling. Each control has to be registered separately. |
attachAfterSave |
Attaches event handler When called, the context of the event handler (its Fired after a variant is saved. This event can be used to retrieve the id of the saved variant. |
attachInitialise |
Attaches event handler When called, the context of the event handler (its Once the |
destroyPersonalizableControl |
Destroys the personalizableControl in the aggregation personalizableControl. |
detachAfterSave |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachInitialise |
Detaches event handler 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
|
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 |
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 |
setCurrentVariantId |
Sets the current variant ID. In case an invalid ID is passed, a standard variant is set. |
setPersonalizableControl |
Sets the aggregated personalizableControl. |
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 |
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 |
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 |
Destroys the personalizableControl in the aggregation personalizableControl.
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 |
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 |
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 |
Fires event afterSave to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event initialise to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Retrieves the current variant ID. For a standard variant, an empty string is returned.
Returns a metadata object for class sap.ui.comp.smartvariants.SmartVariantManagementUi2.
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.
Retrieves the variant content.
Param | Type | DefaultValue | Description |
---|---|---|---|
oControl | sap.ui.core.Control |
current control |
|
sKey | string |
the variant key |
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.
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 |
Sets the aggregated personalizableControl.
Param | Type | DefaultValue | Description |
---|---|---|---|
oPersonalizableControl | sap.ui.comp.smartvariants.PersonalizableInfo |
The personalizableControl to set |