Variant model implementation for JSON format.
Constructor for a new sap.ui.fl.variants.VariantModel model.
new sap.ui.fl.variants.VariantModel(oData, mPropertyBag)
Param | Type | Default Value | Description |
---|---|---|---|
oData | object | Either the URL where to load the JSON from or a JS object |
|
mPropertyBag | object | Map of properties required for the constructor |
|
flexController | sap.ui.fl.FlexController |
|
|
appComponent | sap.ui.core.Component | Application component instance that is currently loading |
Method | Description |
---|---|
checkDirtyStateForControlModels |
Checks if dirty changes exist for the current variant inside the passed variant management reference. If no dirty changes exist, it marks the associated 'modified' model property to |
sap.ui.fl.variants.VariantModel.extend |
Creates a new subclass of class sap.ui.fl.variants.VariantModel with name
|
getCurrentVariantReference |
Returns the current variant for a given variant management control. |
sap.ui.fl.variants.VariantModel.getMetadata |
Returns a metadata object for class sap.ui.fl.variants.VariantModel. |
manageVariants |
Opens the Manage Views dialog. Returns a promise which resolves to changes made from the manage dialog, based on the parameters passed. |
setVariantProperties |
Sets the passed properties on a variant for the passed variant management reference and returns the content for change creation |
Checks if dirty changes exist for the current variant inside the passed variant management reference. If no dirty changes exist, it marks the associated 'modified' model property to false
.
Param | Type | DefaultValue | Description |
---|---|---|---|
aVariantManagementReferences | string[] |
Array of variant management references |
Creates a new subclass of class sap.ui.fl.variants.VariantModel 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.model.json.JSONModel.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 |
Returns the current variant for a given variant management control.
Param | Type | DefaultValue | Description |
---|---|---|---|
sVariantManagementReference | string |
Variant management reference |
Returns a metadata object for class sap.ui.fl.variants.VariantModel.
Opens the Manage Views dialog. Returns a promise which resolves to changes made from the manage dialog, based on the parameters passed.
Param | Type | DefaultValue | Description |
---|---|---|---|
oVariantManagementControl | sap.ui.fl.variants.VariantManagement |
Variant management control |
|
sVariantManagementReference | String |
Variant management reference |
|
sLayer | String |
Current layer |
|
sClass | String |
Style class assigned to the management dialog |
|
oContextSharingComponentPromise | Promise<sap.ui.core.ComponentContainer> |
Promise resolving with the ComponentContainer |
Sets the passed properties on a variant for the passed variant management reference and returns the content for change creation
Param | Type | DefaultValue | Description |
---|---|---|---|
sVariantManagementReference | sap.ui.fl.variants.VariantManagement |
Variant management reference |
|
mPropertyBag | Object |
Map of properties |
|
variantReference | String |
Variant reference for which properties should be set |
|
changeType | String |
Change type due to which properties are being set |
|
layer | String |
Current layer |
|
appComponent | String |
App component instance |
|
title | String |
New app title value for |
|
visible | boolean |
New visible value for |
|
contexts | object |
New contexts object (e.g. roles) for |
|
favorite | boolean |
New favorite value for |
|
executeOnSelect | boolean |
New executeOnSelect value for |
|
defaultVariant | String |
New default variant for |
|
bUpdateCurrentVariant | boolean |
Update current variant |