Provides an API for applications to work with control variants. See also sap.ui.fl.variants.VariantManagement.
Node | Description |
---|
Method | Description |
---|---|
sap.ui.fl.apply.api.ControlVariantApplyAPI.activateVariant |
Activates the passed variant applicable to the passed control/component. |
sap.ui.fl.apply.api.ControlVariantApplyAPI.attachVariantApplied |
Saves a function that will be called after a variant has been applied with the new variant as parameter. Even if the same variant is selected again the callback is called. The function also performs a sanity check after the control has been rendered. If the passed variant control ID does not match the responsible variant management control, the callback will not be saved. Optionally this function is also called after the initial variant is applied without a sanity check. |
sap.ui.fl.apply.api.ControlVariantApplyAPI.clearVariantParameterInURL |
Clears URL technical parameter |
sap.ui.fl.apply.api.ControlVariantApplyAPI.detachVariantApplied |
Removes the saved callback for the given control and variant management control. |
Activates the passed variant applicable to the passed control/component.
Param | Type | DefaultValue | Description |
---|---|---|---|
mPropertyBag | object |
Object with parameters as properties |
|
element | sap.ui.base.ManagedObject string |
Component or control (instance or ID) on which the |
|
variantReference | string |
Reference to the variant that needs to be activated |
Saves a function that will be called after a variant has been applied with the new variant as parameter. Even if the same variant is selected again the callback is called. The function also performs a sanity check after the control has been rendered. If the passed variant control ID does not match the responsible variant management control, the callback will not be saved. Optionally this function is also called after the initial variant is applied without a sanity check.
Param | Type | DefaultValue | Description |
---|---|---|---|
mPropertyBag | object |
Object with parameters as properties |
|
selector | sap.ui.fl.Selector |
Selector of the control |
|
vmControlId | string |
ID of the variant management control |
|
callback | function |
Callback that will be called after a variant has been applied |
|
callAfterInitialVariant | boolean |
The callback will also be called after the initial variant is applied |
Clears URL technical parameter sap-ui-fl-control-variant-id
for control variants. Use this method in case you normally want the variant parameter in the URL, but have a few special navigation patterns where you want to clear it. If you don't want that parameter in general, set the updateVariantInURL
parameter on your variant management control to false
. SAP Fiori elements use this method. If a variant management control is given as a parameter, only parameters specific to that control are cleared.
Param | Type | DefaultValue | Description |
---|---|---|---|
mPropertyBag | object |
Object with parameters as properties |
|
control | sap.ui.base.ManagedObject |
Variant management control for which the URL technical parameter has to be cleared |
Removes the saved callback for the given control and variant management control.
Param | Type | DefaultValue | Description |
---|---|---|---|
mPropertyBag | object |
Object with parameters as properties |
|
selector | sap.ui.fl.Selector |
Selector of the control |
|
vmControlId | string |
ID of the variant management control |