Class sap.ui.comp.smartvariants.SmartVariantManagementModule: sap/ui/comp/smartvariants/SmartVariantManagement
The SmartVariantManagement control is a specialization of the VariantManagement control and communicates with the layer that offers SAPUI5 flexibility services to manage the variants.
For more information about SAPUI5 flexibility, refer to the Developer Guide.
sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the afterSave
event of this sap.ui.comp.smartvariants.SmartVariantManagement
.personalizableControls
.fnFunction
from the afterSave
event of this sap.ui.comp.smartvariants.SmartVariantManagement
.sap.ui.comp.smartvariants.PersonalizableInfo
in the aggregation personalizableControls
.personalizableControls
.personalizableControls
.personalizableControls
.fnFunction
to the initialise
event of this sap.ui.comp.smartvariants.SmartVariantManagement
.fnFunction
from the initialise
event of this sap.ui.comp.smartvariants.SmartVariantManagement
.The call sequence is as follows:
A control for which personalization is used has to be registered first via the
personalizableControls
association. Then it has to call the initialise
method with the arguments fCallback
function which will be called once the personalization data has been retrieved and oPersoControl
, the control itself.Note: the function callback has to be defined in the personalizable control.
The old behavior, where the control has to register to the
initialise
event, before the initialise
method call, should not be used any longer and is not supported at all for the page variant scenarios. Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- persistencyKey : string
- Aggregations
- personalizableControls : sap.ui.comp.smartvariants.PersonalizableInfo[]
- Events
- initialise : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- afterSave : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.comp.variants.VariantManagement can be used as well.
{string} | sId? | ID for the new control, generated automatically if no ID is given |
{object} | mSettings? | initial settings for the new control |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters |
- Deprecated:
- Since version 1.38.0. Replaced by providing the personalizable control and the callback via the
initialise
-method.
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.
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
{sap.ui.comp.smartvariants.PersonalizableInfo} | oCurrentControlInfo | Provides information about the personalizable control. |
fnFunction
to the afterSave
event of this sap.ui.comp.smartvariants.SmartVariantManagement
. 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.SmartVariantManagement
itself.
This event is fired after a variant has been saved. This event can be used to retrieve the ID of the saved variant.
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.comp.smartvariants.SmartVariantManagement itself |
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
personalizableControls
. {sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
fnFunction
from the afterSave
event of this sap.ui.comp.smartvariants.SmartVariantManagement
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
afterSave
to attached listeners. {Map} | mArguments? | The arguments to pass along with the event |
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
{object} | oVariantInfo | Describes the variants that will be deleted/renamed |
{object} | oVariantInfo | Describes the variant to be saved |
{object} | oVariantInfo | Describes the selected variant |
- Since:
- 1.28.1
{string} | Current variant ID |
persistencyKey
. Key used to access personalization data.
{string} | Value of property persistencyKey |
personalizableControls
. All controls that rely on variant handling have to be added to this aggregation.
{sap.ui.comp.smartvariants.PersonalizableInfo[]} |
{sap.ui.core.Control} | oCurrentControl | Current personalizable control |
{Object} | The standard variant. |
{sap.ui.core.Control} | oControl | Current personalizable control |
{string} | sKey | The variant key |
{object} | JSON Representing the content of the variant |
sap.ui.comp.smartvariants.PersonalizableInfo
in the aggregation personalizableControls
. and returns its index if found or -1 otherwise. {sap.ui.comp.smartvariants.PersonalizableInfo} | oPersonalizableControl | The personalizableControl whose index is looked for |
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
{function} | fCallback | Function will be called whenever the data for the personalizable control is received |
{sap.ui.core.Control} | oPersoControl | Current control that can be personalized |
personalizableControls
. {sap.ui.comp.smartvariants.PersonalizableInfo} | oPersonalizableControl | the personalizableControl to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the personalizableControl should be inserted at; for a negative value of iIndex , the personalizableControl is inserted at position 0; for a value greater than the current size of the aggregation, the personalizableControl is inserted at the last position |
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
{boolean} | true if it is a page variant, otherwise false |
personalizableControls
. Additionally, it unregisters them from the hosting UIArea.
{sap.ui.comp.smartvariants.PersonalizableInfo[]} | An array of the removed elements (might be empty) |
personalizableControls
. {int|string|sap.ui.comp.smartvariants.PersonalizableInfo} | vPersonalizableControl | The personalizableControlto remove or its index or id |
{sap.ui.comp.smartvariants.PersonalizableInfo} | The removed personalizableControl or null |
{string} | sVariantKey | The variant key |
{boolean} | bDoNotApplyVariant | If set to true , the applyVariant method is not executed yet. Relevant during navigation, when called before the initialise event has been executed. |
- Since:
- 1.28.1
persistencyKey
. Key used to access personalization data.
When called with a value of null
or undefined
, the default value of the property will be restored.
{string} | sPersistencyKey | New value for property persistencyKey |
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
fnFunction
to the initialise
event of this sap.ui.comp.smartvariants.SmartVariantManagement
. 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.SmartVariantManagement
itself.
This event is fired when the SmartVariantManagement control is initialized.
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.comp.smartvariants.SmartVariantManagement itself |
- Deprecated:
- Since version 1.38.0. Replaced by providing the personalizable control and the callback via the
initialise
-method.
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
fnFunction
from the initialise
event of this sap.ui.comp.smartvariants.SmartVariantManagement
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
- Deprecated:
- Since version 1.38.0. Replaced by providing the personalizable control and the callback via the
initialise
-method.
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |
initialise
to attached listeners. {Map} | mArguments? | The arguments to pass along with the event |
- Deprecated:
- Since version 1.38.0. Replaced by providing the personalizable control and the callback via the
initialise
-method.
{sap.ui.comp.smartvariants.SmartVariantManagement} | Reference to this in order to allow method chaining |