src/sap.ui.fl/src/sap/ui/fl/variants/VariantModel.js
function() {
		var aVariantManagementReferences = Object.keys(this.oData);
		aVariantManagementReferences.forEach(function(sVariantManagementReference) {
			var mPropertyBag = {
				variantManagementReference: sVariantManagementReference,
				currentVariantReference: this.oData[sVariantManagementReference].currentVariant || this.oData[sVariantManagementReference].defaultVariant ,
				newVariantReference: true // since new variant is not known - true will lead to no new changes for variant switch
			};
			var mChangesToBeSwitched = this.oChangePersistence.loadSwitchChangesMapForComponent(mPropertyBag);
			this._oVariantSwitchPromise = this._oVariantSwitchPromise
				.then(this.oFlexController.revertChangesOnControl.bind(this.oFlexController, mChangesToBeSwitched.changesToBeReverted, this.oAppComponent))
				.then(function() {
					delete this.oData[sVariantManagementReference];
					delete this.oVariantController.getChangeFileContent()[sVariantManagementReference];
					this._ensureStandardVariantExists(sVariantManagementReference);
				}.bind(this));
		}.bind(this));
		//re-initialize hash register and remove existing parameters
		VariantUtil.initializeHashRegister.call(this);
		this.updateHasherEntry({
			parameters: []
		});
		return this._oVariantSwitchPromise;
	}
function() {
		var aVariantManagementReferences = Object.keys(this.oData);
		aVariantManagementReferences.forEach(function(sVariantManagementReference) {
			var mPropertyBag = {
				variantManagementReference: sVariantManagementReference,
				currentVariantReference: this.oData[sVariantManagementReference].currentVariant || this.oData[sVariantManagementReference].defaultVariant ,
				newVariantReference: true // since new variant is not known - true will lead to no new changes for variant switch
			};
			var mChangesToBeSwitched = this.oChangePersistence.loadSwitchChangesMapForComponent(mPropertyBag);
			this._oVariantSwitchPromise = this._oVariantSwitchPromise
				.then(this.oFlexController.revertChangesOnControl.bind(this.oFlexController, mChangesToBeSwitched.changesToBeReverted, this.oAppComponent))
				.then(function() {
					delete this.oData[sVariantManagementReference];
					delete this.oVariantController.getChangeFileContent()[sVariantManagementReference];
					this._ensureStandardVariantExists(sVariantManagementReference);
				}.bind(this));
		}.bind(this));
		//re-initialize hash register and remove existing parameters
		VariantUtil.initializeHashRegister.call(this);
		this.updateHasherEntry({
			parameters: []
		});
		return this._oVariantSwitchPromise;
	}
function ( ) { var aVariantManagementReferences = Object . keys ( this . oData ) ; aVariantManagementReferences . forEach ( function ( sVariantManagementReference ) { var mPropertyBag = { variantManagementReference : sVariantManagementReference , currentVariantReference : this . oData [ sVariantManagementReference ] . currentVariant || this . oData [ sVariantManagementReference ] . defaultVariant , newVariantReference : true // since new variant is not known - true will lead to no new changes for variant switch } ; var mChangesToBeSwitched = this . oChangePersistence . loadSwitchChangesMapForComponent ( mPropertyBag ) ; this . _oVariantSwitchPromise = this . _oVariantSwitchPromise . then ( this . oFlexController . revertChangesOnControl . bind ( this . oFlexController , mChangesToBeSwitched . changesToBeReverted , this . oAppComponent ) ) . then ( function ( ) { delete this . oData [ sVariantManagementReference ] ; delete this . oVariantController . getChangeFileContent ( ) [ sVariantManagementReference ] ; this . _ensureStandardVariantExists ( sVariantManagementReference ) ; } . bind ( this ) ) ; } . bind ( this ) ) ; //re-initialize hash register and remove existing parameters VariantUtil . initializeHashRegister . call ( this ) ; this . updateHasherEntry ( { parameters : [ ] } ) ; return this . _oVariantSwitchPromise ; }
When VariantController map is reset at runtime, this listener is called.
It reverts all applied changes and resets all variant management controls to default state.
@returns {Promise} Promise which resolves when all applied changes have been reverted
When VariantController map is reset at runtime this listener is called . It reverts all applied changes and resets all variant management controls to default state .