The VariantManagement control can be used to manage variants, such as filter bar variants or table variants.
Constructor for a new VariantManagement.
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.variants.VariantManagement(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: items
Name | Cardinality | Type | Description |
---|---|---|---|
items (default) | 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 |
---|---|
manage |
This event is fired when users apply changes to variants in the Manage Variants dialog. |
save |
This event is fired when the Save Variant dialog is closed with OK for a variant. |
select |
This event is fired when a new variant is selected. |
This event is fired when users apply changes to variants in the Manage Variants dialog.
Since: 1.22.0.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
renamed | string[] |
List of changed variant keys |
deleted | string[] |
List of deleted variant keys |
exe | object[] |
List of variant keys and the associated Execute on Selection indicator |
def | boolean |
The default variant key |
This event is fired when the Save Variant dialog is closed with OK for a variant.
Since: 1.22.0.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
name | string |
The variant title |
overwrite | boolean |
Indicates if an existing variant is overwritten or if a new variant is created |
key | string |
The variant key |
exe | boolean |
The Execute on Selection indicator |
def | boolean |
The default variant indicator |
global | boolean |
The shared variant indicator |
lifecyclePackage | string |
The package name |
lifecycleTransportId | string |
The transport ID |
Method | Description |
---|---|
addItem |
Adds some item to the aggregation items.
Since 1.26.0 Replaced by association <code>variantItems</code>
|
addVariantItem |
Adds some variantItem to the aggregation variantItems. |
attachManage |
Attaches event handler When called, the context of the event handler (its This event is fired when users apply changes to variants in the Manage Variants dialog. |
attachSave |
Attaches event handler When called, the context of the event handler (its This event is fired when the Save Variant dialog is closed with OK for a variant. |
attachSelect |
Attaches event handler When called, the context of the event handler (its This event is fired when a new variant is selected. |
clearVariantSelection |
Removes the current variant selection and resets to default value. |
currentVariantGetModified |
Gets the dirty flag of the current variant. |
currentVariantSetModified |
Sets the dirty flag of the current variant. |
destroyItems |
Destroys all the items in the aggregation items.
Since 1.26.0 Replaced by association <code>variantItems</code>
|
destroyVariantItems |
Destroys all the variantItems in the aggregation variantItems. |
detachManage |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSave |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.comp.variants.VariantManagement.extend |
Creates a new subclass of class sap.ui.comp.variants.VariantManagement with name
|
fireManage |
Fires event manage to attached listeners. |
fireSave |
Fires event save to attached listeners. |
fireSelect |
Fires event select to attached listeners. |
getDefaultVariantKey |
Gets current value of property defaultVariantKey. Provides a string value to set the default variant. Used for the save dialog. Has no effect on the selected variant. |
getEnabled |
Gets current value of property enabled. Can be set to true or false depending on whether you want to enable or disable the control. Default value is |
getInErrorState |
Gets current value of property inErrorState. Indicates that the control is in error state. If set to Default value is |
getInitialSelectionKey |
Gets current value of property initialSelectionKey. Enables the setting of the initially selected variant. |
getItems |
Gets content of aggregation items. Items displayed by the
Since 1.26.0 Replaced by association <code>variantItems</code>
|
getLifecycleSupport |
Gets current value of property lifecycleSupport. Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants. Default value is |
sap.ui.comp.variants.VariantManagement.getMetadata |
Returns a metadata object for class sap.ui.comp.variants.VariantManagement. |
getOverflowToolbarConfig |
Required by the sap.m.IOverflowToolbarContent interface. Registers invalidations event which is fired when width of the control is changed. |
getSelectionKey |
Gets current value of property selectionKey. 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. |
getShowCreateTile |
Gets current value of property showCreateTile. Indicates that a Create Tile is visible in the Create dialog. Default value is |
getShowExecuteOnSelection |
Gets current value of property showExecuteOnSelection. Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs. Default value is |
getShowSetAsDefault |
Gets current value of property showSetAsDefault. Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs. Default value is |
getShowShare |
Gets current value of property showShare. 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. Default value is |
getStandardItemAuthor |
Gets current value of property standardItemAuthor. Defines the author of the standard variant, for example, the name of the own company. Default value is |
getStandardItemText |
Gets current value of property standardItemText. Overwrites the default Standard variant title. |
getUseFavorites |
Gets current value of property useFavorites. Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list. Default value is |
getVariantCreationByUserAllowed |
Gets current value of property variantCreationByUserAllowed. Indicates that end users are allowed to create variants. Default value is |
getVariantItems |
Gets content of aggregation variantItems. Variant items displayed by the |
indexOfItem |
Checks for the provided
Since 1.26.0 Replaced by association <code>variantItems</code>
|
indexOfVariantItem |
Checks for the provided |
insertItem |
Inserts a item into the aggregation items.
Since 1.26.0 Replaced by association <code>variantItems</code>
|
insertVariantItem |
Inserts a variantItem into the aggregation variantItems. |
removeAllItems |
Removes all the controls from the aggregation items. Additionally, it unregisters them from the hosting UIArea.
Since 1.26.0 Replaced by association <code>variantItems</code>
|
removeAllVariantItems |
Removes all the controls from the aggregation variantItems. Additionally, it unregisters them from the hosting UIArea. |
removeItem |
Removes a item from the aggregation items.
Since 1.26.0 Replaced by association <code>variantItems</code>
|
removeVariantItem |
Removes a variantItem from the aggregation variantItems. |
setBackwardCompatibility |
Defines the internal mode. The VariantManagement is able to support two different modes: |
setDefaultVariantKey |
Sets a new value for property defaultVariantKey. Provides a string value to set the default variant. Used for the save dialog. Has no effect on the selected variant. When called with a value of |
setEnabled |
Sets a new value for property enabled. Can be set to true or false depending on whether you want to enable or disable the control. When called with a value of Default value is |
setInErrorState |
Sets a new value for property inErrorState. Indicates that the control is in error state. If set to When called with a value of Default value is |
setInitialSelectionKey |
Sets a new value for property initialSelectionKey. Enables the setting of the initially selected variant. When called with a value of |
setLifecycleSupport |
Sets a new value for property lifecycleSupport. Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants. When called with a value of Default value is |
setSelectionKey |
Sets a new value for property selectionKey. 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. When called with a value of |
setShowCreateTile |
Sets a new value for property showCreateTile. Indicates that a Create Tile is visible in the Create dialog. When called with a value of Default value is |
setShowExecuteOnSelection |
Sets a new value for property showExecuteOnSelection. Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs. When called with a value of Default value is |
setShowSetAsDefault |
Sets a new value for property showSetAsDefault. Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs. When called with a value of Default value is |
setShowShare |
Sets a new value for property showShare. 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. When called with a value of Default value is |
setStandardItemAuthor |
Sets a new value for property standardItemAuthor. Defines the author of the standard variant, for example, the name of the own company. When called with a value of Default value is |
setStandardItemText |
Sets a new value for property standardItemText. Overwrites the default Standard variant title. When called with a value of |
setUseFavorites |
Sets a new value for property useFavorites. Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list. When called with a value of Default value is |
setVariantCreationByUserAllowed |
Sets a new value for property variantCreationByUserAllowed. Indicates that end users are allowed to create variants. When called with a value of Default value is |
Adds some item to the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to add; if empty, nothing is inserted |
Adds some variantItem to the aggregation variantItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
oVariantItem | sap.ui.comp.variants.VariantItem |
The variantItem to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the manage event of this sap.ui.comp.variants.VariantManagement
.
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.variants.VariantManagement
itself.
This event is fired when users apply changes to variants in the Manage Variants dialog.
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 save event of this sap.ui.comp.variants.VariantManagement
.
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.variants.VariantManagement
itself.
This event is fired when the Save Variant dialog is closed with OK for a 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 select event of this sap.ui.comp.variants.VariantManagement
.
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.variants.VariantManagement
itself.
This event is fired when a new variant is selected.
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 |
Sets the dirty flag of the current variant.
Param | Type | DefaultValue | Description |
---|---|---|---|
bFlag | boolean |
The value indicating the dirty state of the current variant |
Destroys all the items in the aggregation items.
Detaches event handler fnFunction
from the manage event of this sap.ui.comp.variants.VariantManagement
.
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 save event of this sap.ui.comp.variants.VariantManagement
.
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 select event of this sap.ui.comp.variants.VariantManagement
.
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.variants.VariantManagement 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.core.Control.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 manage to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
renamed | string[] |
List of changed variant keys |
|
deleted | string[] |
List of deleted variant keys |
|
exe | object[] |
List of variant keys and the associated Execute on Selection indicator |
|
def | boolean |
The default variant key |
Fires event save to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
name | string |
The variant title |
|
overwrite | boolean |
Indicates if an existing variant is overwritten or if a new variant is created |
|
key | string |
The variant key |
|
exe | boolean |
The Execute on Selection indicator |
|
def | boolean |
The default variant indicator |
|
global | boolean |
The shared variant indicator |
|
lifecyclePackage | string |
The package name |
|
lifecycleTransportId | string |
The transport ID |
Fires event select to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
key | string |
The variant key |
Gets current value of property defaultVariantKey.
Provides a string value to set the default variant. Used for the save dialog. Has no effect on the selected variant.
Gets current value of property enabled.
Can be set to true or false depending on whether you want to enable or disable the control.
Default value is true
.
Gets current value of property inErrorState.
Indicates that the control is in error state. If set to true
error message will be displayed whenever the variant is opened.
Default value is false
.
Gets current value of property initialSelectionKey.
Enables the setting of the initially selected variant.
Gets content of aggregation items.
Items displayed by the VariantManagement
control.
Gets current value of property lifecycleSupport.
Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants.
Default value is false
.
Returns a metadata object for class sap.ui.comp.variants.VariantManagement.
Required by the sap.m.IOverflowToolbarContent interface. Registers invalidations event which is fired when width of the control is changed.
Gets current value of property selectionKey.
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.
Gets current value of property showCreateTile.
Indicates that a Create Tile is visible in the Create dialog.
Default value is false
.
Gets current value of property showExecuteOnSelection.
Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs.
Default value is false
.
Gets current value of property showSetAsDefault.
Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs.
Default value is true
.
Gets current value of property standardItemAuthor.
Defines the author of the standard variant, for example, the name of the own company.
Default value is "SAP"
.
Gets current value of property standardItemText.
Overwrites the default Standard variant title.
Gets current value of property useFavorites.
Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list.
Default value is false
.
Gets current value of property variantCreationByUserAllowed.
Indicates that end users are allowed to create variants.
Default value is true
.
Gets content of aggregation variantItems.
Variant items displayed by the VariantManagement
control.
Checks for the provided sap.ui.core.Item
in the aggregation items. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item whose index is looked for |
Checks for the provided sap.ui.comp.variants.VariantItem
in the aggregation variantItems. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oVariantItem | sap.ui.comp.variants.VariantItem |
The variantItem whose index is looked for |
Inserts a item into the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.ui.core.Item |
The item to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Inserts a variantItem into the aggregation variantItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
oVariantItem | sap.ui.comp.variants.VariantItem |
The variantItem to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation items.
Additionally, it unregisters them from the hosting UIArea.
Removes all the controls from the aggregation variantItems.
Additionally, it unregisters them from the hosting UIArea.
Removes a item from the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | int string sap.ui.core.Item |
The item to remove or its index or id |
Removes a variantItem from the aggregation variantItems.
Param | Type | DefaultValue | Description |
---|---|---|---|
vVariantItem | int string sap.ui.comp.variants.VariantItem |
The variantItem to remove or its index or id |
Defines the internal mode. The VariantManagement is able to support two different modes:
1. the mode with standard entry displayed as 'Default' and
2. the mode with standard entry displayed as 'Standard'.
The 'Default' display is the initial mode.
Note:
this method has to be executed, before any items are assigned to the VariantManagement control!
Param | Type | DefaultValue | Description |
---|---|---|---|
bFlag | boolean |
defines the behavior: |
Sets a new value for property defaultVariantKey.
Provides a string value to set the default variant. Used for the save dialog. Has no effect on the selected variant.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sDefaultVariantKey | string |
New value for property |
Sets a new value for property enabled.
Can be set to true or false depending on whether you want to enable or disable the control.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEnabled | boolean | true |
New value for property |
Sets a new value for property inErrorState.
Indicates that the control is in error state. If set to true
error message will be displayed whenever the variant is opened.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bInErrorState | boolean | false |
New value for property |
Sets a new value for property initialSelectionKey.
Enables the setting of the initially selected variant.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sInitialSelectionKey | string |
New value for property |
Sets a new value for property lifecycleSupport.
Enables the lifecycle support. If set to true, the VariantManagement control handles the transport information for shared variants.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bLifecycleSupport | boolean | false |
New value for property |
Sets a new value for property selectionKey.
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.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sSelectionKey | string |
New value for property |
Sets a new value for property showCreateTile.
Indicates that a Create Tile is visible in the Create dialog.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowCreateTile | boolean | false |
New value for property |
Sets a new value for property showExecuteOnSelection.
Indicates that Execute on Selection is visible in the Save Variant and the Manage Variants dialogs.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowExecuteOnSelection | boolean | false |
New value for property |
Sets a new value for property showSetAsDefault.
Indicates that set as default is visible in the Save Variant and the Manage Variants dialogs.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bShowSetAsDefault | boolean | true |
New value for property |
Sets a new value for property standardItemAuthor.
Defines the author of the standard variant, for example, the name of the own company.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is "SAP"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sStandardItemAuthor | string | "SAP" |
New value for property |
Sets a new value for property standardItemText.
Overwrites the default Standard variant title.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sStandardItemText | string |
New value for property |
Sets a new value for property useFavorites.
Indicates that the 'Favorites' feature is used. Only variants marked as favorites will be displayed in the variant list.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bUseFavorites | boolean | false |
New value for property |
Sets a new value for property variantCreationByUserAllowed.
Indicates that end users are allowed to create variants.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bVariantCreationByUserAllowed | boolean | true |
New value for property |