Class sap.ui.comp.smartvariants.SmartVariantManagementUi2Module: sap/ui/comp/smartvariants/SmartVariantManagementUi2


The SmartVariantManagementUi2 control is a specialization of the VariantManagement control and communicates with the Ui2 personalization layer to manage the variants.

Constructor Summary
new sap.ui.comp.smartvariants.SmartVariantManagementUi2(sId?, mSettings?)Constructor for a new SmartVariantManagementUi2.
Event Summary
afterSave(oControlEvent)Fired after a variant is saved.
initialise(oControlEvent)Once the SmartVariantManagement 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
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.comp.smartvariants.SmartVariantManagementUi2.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.comp.smartvariants.SmartVariantManagementUi2 with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.comp.smartvariants.SmartVariantManagementUi2.getMetadata()Returns a metadata object for class sap.ui.comp.smartvariants.SmartVariantManagementUi2.
addPersonalizableControl(oCurrentControlInfo)Registers all controls interested and relying on variant handling.
attachAfterSave(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.
attachInitialise(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.
destroyPersonalizableControl()Destroys the personalizableControl in the aggregation personalizableControl.
detachAfterSave(fnFunction, oListener)Detaches event handler fnFunction from the afterSave event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.
detachInitialise(fnFunction, oListener)Detaches event handler fnFunction from the initialise event of this sap.ui.comp.smartvariants.SmartVariantManagementUi2.
exit()Destroys the control.
fireAfterSave(mArguments?)Fires event afterSave to attached listeners.
fireInitialise(mArguments?)Fires event initialise to attached listeners.
getCurrentVariantId()Retrieves the current variant ID.
getPersonalizableControl()Gets content of aggregation personalizableControl.
getVariantContent(oControl, sKey)Retrieves the variant content.
init()Control initialization.
initialise()Initializes the UI2 personalization layer by retrieving the list of variants.
isPageVariant()Determines if the SmartVariantManagement instance is a page variant.
setCurrentVariantId(sVariantId, bDoNotApplyVariant)Sets the current variant ID.
setPersonalizableControl(oPersonalizableControl)Sets the aggregated personalizableControl.
Constructor Detail
new sap.ui.comp.smartvariants.SmartVariantManagementUi2(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Aggregations
  • 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.

Parameters:
{string}sId? ID for the new control, generated automatically if no ID is given
{object}mSettings? Initial settings for the new control
Event Detail
afterSave(oControlEvent)
Fired after a variant is saved. This event can be used to retrieve the id of the saved variant.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
initialise(oControlEvent)
Once the SmartVariantManagement 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
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ui.comp.smartvariants.SmartVariantManagementUi2.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

Parameters:
{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
Returns:
{function} Created class / constructor function
sap.ui.comp.smartvariants.SmartVariantManagementUi2.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.comp.smartvariants.SmartVariantManagementUi2.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addPersonalizableControl(oCurrentControlInfo)
Registers all controls interested and relying on variant handling.
Parameters:
{sap.ui.comp/smartvariants/PersonalizableInfo}oCurrentControlInfo control providing the required aggregation for flex-layer
attachAfterSave(oData?, fnFunction, oListener?): sap.ui.comp.smartvariants.SmartVariantManagementUi2
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.

Parameters:
{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.SmartVariantManagementUi2 itself
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
attachInitialise(oData?, fnFunction, oListener?): sap.ui.comp.smartvariants.SmartVariantManagementUi2
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 SmartVariantManagement 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

Parameters:
{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.SmartVariantManagementUi2 itself
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
Destroys the personalizableControl in the aggregation personalizableControl.
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
detachAfterSave(fnFunction, oListener): sap.ui.comp.smartvariants.SmartVariantManagementUi2
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
detachInitialise(fnFunction, oListener): sap.ui.comp.smartvariants.SmartVariantManagementUi2
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
exit()
Destroys the control.
Fires event afterSave to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
Fires event initialise to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining
getCurrentVariantId(): string
Retrieves the current variant ID. For a standard variant, an empty string is returned.
Returns:
{string} Current variant ID
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.

Returns:
{sap.ui.comp.smartvariants.PersonalizableInfo}
getVariantContent(oControl, sKey): object
Retrieves the variant content.
Parameters:
{sap.ui.core.Control}oControl current control
{string}sKey the variant key
Returns:
{object} json object representing the content of the variant
init()
Control initialization.
Since:
1.28.0
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(): boolean
Determines if the SmartVariantManagement instance is a page variant.
Returns:
{boolean} always returns false
setCurrentVariantId(sVariantId, bDoNotApplyVariant)
Sets the current variant ID.
Parameters:
{string}sVariantId ID of the variant
{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
setPersonalizableControl(oPersonalizableControl): sap.ui.comp.smartvariants.SmartVariantManagementUi2
Sets the aggregated personalizableControl.
Parameters:
{sap.ui.comp.smartvariants.PersonalizableInfo}oPersonalizableControl The personalizableControl to set
Returns:
{sap.ui.comp.smartvariants.SmartVariantManagementUi2} Reference to this in order to allow method chaining