@sapui5/sap.fe.core 1.99.0 → 1.99.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ sap.ui.define(
22
22
  "sap/ui/core/MessageType",
23
23
  "sap/fe/core/helpers/ModelHelper"
24
24
  ],
25
- function(
25
+ function (
26
26
  ControllerExtension,
27
27
  OverrideExecution,
28
28
  Log,
@@ -99,7 +99,7 @@ sap.ui.define(
99
99
  * @public
100
100
  * @since 1.90.0
101
101
  */
102
- editDocument: function(oContext, mParameters) {
102
+ editDocument: function (oContext, mParameters) {
103
103
  mParameters = mParameters || {};
104
104
  var that = this,
105
105
  bPrepareOnEdit = mParameters.prepareOnEdit || undefined,
@@ -117,7 +117,7 @@ sap.ui.define(
117
117
  that._getMessageHandler()
118
118
  )
119
119
  )
120
- .then(function(oNewDocumentContext) {
120
+ .then(function (oNewDocumentContext) {
121
121
  var sProgrammingModel = that._getProgrammingModel(oContext);
122
122
 
123
123
  if (sProgrammingModel === ProgrammingModel.Sticky) {
@@ -130,7 +130,7 @@ sap.ui.define(
130
130
  if (oNewDocumentContext !== oContext) {
131
131
  return that
132
132
  ._handleNewContext(oNewDocumentContext, true, undefined, bDraftNavigation, true)
133
- .then(function() {
133
+ .then(function () {
134
134
  if (sProgrammingModel === ProgrammingModel.Sticky) {
135
135
  // The stickyOn handler must be set after the navigation has been done,
136
136
  // as the URL may change in the case of FCL
@@ -140,12 +140,12 @@ sap.ui.define(
140
140
  }
141
141
  }
142
142
  })
143
- .catch(function(oError) {
143
+ .catch(function (oError) {
144
144
  Log.error("Error while editing the document", oError);
145
145
  });
146
146
  },
147
147
 
148
- deleteMultipleDocuments: function(aContexts, mParameters) {
148
+ deleteMultipleDocuments: function (aContexts, mParameters) {
149
149
  if (mParameters) {
150
150
  mParameters.beforeDeleteCallBack = this.base.editFlow.onBeforeDelete;
151
151
  } else {
@@ -153,10 +153,7 @@ sap.ui.define(
153
153
  beforeDeleteCallBack: this.base.editFlow.onBeforeDelete
154
154
  };
155
155
  }
156
- return this.base
157
- .getView()
158
- .getController()
159
- ._editFlow.deleteMultipleDocuments(aContexts, mParameters);
156
+ return this.base.getView().getController()._editFlow.deleteMultipleDocuments(aContexts, mParameters);
160
157
  },
161
158
 
162
159
  /**
@@ -170,14 +167,14 @@ sap.ui.define(
170
167
  * @public
171
168
  * @since 1.90.0
172
169
  */
173
- updateDocument: function(oContext, oPromise) {
170
+ updateDocument: function (oContext, oPromise) {
174
171
  var that = this,
175
172
  transactionHelper = that._getTransactionHelper(),
176
173
  oBindingContext = that.getView().getBindingContext(),
177
174
  bIsDraft = that._getProgrammingModel(oContext) === ProgrammingModel.Draft;
178
175
 
179
176
  this._getMessageHandler().removeTransitionMessages();
180
- return this._syncTask(function() {
177
+ return this._syncTask(function () {
181
178
  if (oBindingContext) {
182
179
  transactionHelper.handleDocumentModifications();
183
180
  EditState.setEditStateDirty();
@@ -190,7 +187,7 @@ sap.ui.define(
190
187
 
191
188
  return oPromise
192
189
  .then(
193
- function() {
190
+ function () {
194
191
  if (bIsDraft && oBindingContext) {
195
192
  var oMetaModel = oBindingContext.getModel().getMetaModel(),
196
193
  sEntitySetName = oMetaModel.getMetaContext(oBindingContext.getPath()).getObject("@sapui.name"),
@@ -204,7 +201,7 @@ sap.ui.define(
204
201
  sChangedPath = SemanticKeyHelper.getSemanticPath(oBindingContext, true);
205
202
 
206
203
  if (sCurrentSemanticPath !== sChangedPath) {
207
- return that._handleNewContext(oBindingContext, true, undefined, true).then(function() {
204
+ return that._handleNewContext(oBindingContext, true, undefined, true).then(function () {
208
205
  that._setDraftStatus(DraftStatus.Saved);
209
206
  });
210
207
  } else {
@@ -215,16 +212,16 @@ sap.ui.define(
215
212
  }
216
213
  }
217
214
  },
218
- function() {
215
+ function () {
219
216
  if (bIsDraft && oBindingContext) {
220
217
  that._setDraftStatus(DraftStatus.Clear);
221
218
  }
222
219
  }
223
220
  )
224
- .catch(function(oError) {
221
+ .catch(function (oError) {
225
222
  Log.error("Error while updating the document", oError);
226
223
  })
227
- .finally(function() {
224
+ .finally(function () {
228
225
  that._getMessageHandler().showMessages();
229
226
  });
230
227
  });
@@ -256,7 +253,7 @@ sap.ui.define(
256
253
  * @public
257
254
  * @since 1.90.0
258
255
  */
259
- createDocument: function(vListBinding, mParameters) {
256
+ createDocument: function (vListBinding, mParameters) {
260
257
  var that = this,
261
258
  transactionHelper = this._getTransactionHelper(),
262
259
  oLockObject = this._getGlobalUIModel(),
@@ -275,7 +272,7 @@ sap.ui.define(
275
272
  if (mParameters.creationMode === CreationMode.External) {
276
273
  // Create by navigating to an external target
277
274
  // TODO: Call appropriate function (currently using the same as for outbound chevron nav, and without any context - 3rd param)
278
- return this._syncTask().then(function() {
275
+ return this._syncTask().then(function () {
279
276
  var oController = that.getView().getController(),
280
277
  sCreatePath = ModelHelper.getAbsoluteMetaPathForListBinding(that.getView(), vListBinding);
281
278
 
@@ -313,11 +310,11 @@ sap.ui.define(
313
310
  */
314
311
  function handleSideEffects(oListBinding, oCreationPromise) {
315
312
  oCreationPromise
316
- .then(function(oNewContext) {
313
+ .then(function (oNewContext) {
317
314
  // transient contexts are reliably removed once oNewContext.created() is resolved
318
315
  return oNewContext.created();
319
316
  })
320
- .then(function() {
317
+ .then(function () {
321
318
  var oBindingContext = that.getView().getBindingContext();
322
319
  // if there are transient contexts, we must avoid requesting side effects
323
320
  // this is avoid a potential list refresh, there could be a side effect that refreshes the list binding
@@ -329,7 +326,7 @@ sap.ui.define(
329
326
  .requestSideEffectsForNavigationProperty(oListBinding.getPath(), oBindingContext);
330
327
  }
331
328
  })
332
- .catch(function(oError) {
329
+ .catch(function (oError) {
333
330
  Log.error("Error while creating the document", oError);
334
331
  });
335
332
  }
@@ -349,13 +346,13 @@ sap.ui.define(
349
346
  oMessageManager
350
347
  .getMessageModel()
351
348
  .getData()
352
- .forEach(function(oMessage) {
349
+ .forEach(function (oMessage) {
353
350
  if (oMessage.code === sCustomValidationFunction) {
354
351
  oMessageManager.removeMessages(oMessage);
355
352
  }
356
353
  });
357
354
 
358
- aValidationMessages.forEach(function(oValidationMessage) {
355
+ aValidationMessages.forEach(function (oValidationMessage) {
359
356
  // Handle Bound CustomValidation message
360
357
  if (oValidationMessage.messageTarget) {
361
358
  oFieldControl = sap.ui.getCore().getControl(mCustomValidity[oValidationMessage.messageTarget].fieldId);
@@ -365,7 +362,7 @@ sap.ui.define(
365
362
  oMessageManager
366
363
  .getMessageModel()
367
364
  .getData()
368
- .filter(function(oMessage) {
365
+ .filter(function (oMessage) {
369
366
  return oMessage.target === sTarget;
370
367
  }).length === 0
371
368
  ) {
@@ -385,7 +382,7 @@ sap.ui.define(
385
382
  var aExistingValidationMessages = oMessageManager
386
383
  .getMessageModel()
387
384
  .getData()
388
- .filter(function(oMessage) {
385
+ .filter(function (oMessage) {
389
386
  return oMessage.target === sTarget;
390
387
  });
391
388
  aExistingValidationMessages[0].addControlId(mCustomValidity[oValidationMessage.messageTarget].fieldId);
@@ -410,7 +407,7 @@ sap.ui.define(
410
407
 
411
408
  bShouldBusyLock && BusyLocker.lock(oLockObject);
412
409
  return this._syncTask(oExecCustomValidation)
413
- .then(function(aValidationMessages) {
410
+ .then(function (aValidationMessages) {
414
411
  if (aValidationMessages.length > 0) {
415
412
  createCustomValidationMessages(aValidationMessages);
416
413
  Log.error("Custom Validation failed");
@@ -438,7 +435,7 @@ sap.ui.define(
438
435
  var sCreationMode = mParameters.creationMode;
439
436
 
440
437
  return Promise.resolve(that._getProgrammingModel(oListBinding))
441
- .then(function(programmingModel) {
438
+ .then(function (programmingModel) {
442
439
  sProgrammingModel = programmingModel;
443
440
  if (sCreationMode && sCreationMode !== CreationMode.NewPage) {
444
441
  // use the passed creation mode
@@ -476,7 +473,7 @@ sap.ui.define(
476
473
  return CreationMode.Async;
477
474
  }
478
475
  })
479
- .then(function(sCreationMode) {
476
+ .then(function (sCreationMode) {
480
477
  var oCreation,
481
478
  mArgs,
482
479
  oCreationRow = mParameters.creationRow,
@@ -494,7 +491,7 @@ sap.ui.define(
494
491
  // prefill data from creation row
495
492
  oPayload = oCreationRowContext.getObject();
496
493
  mParameters.data = {};
497
- Object.keys(oPayload).forEach(function(sPropertyPath) {
494
+ Object.keys(oPayload).forEach(function (sPropertyPath) {
498
495
  var oProperty = oMetaModel.getObject(sMetaPath + "/" + sPropertyPath);
499
496
  // ensure navigation properties are not part of the payload, deep create not supported
500
497
  if (oProperty && oProperty.$kind === "NavigationProperty") {
@@ -514,7 +511,7 @@ sap.ui.define(
514
511
  that._handleCreateEvents(oListBinding);
515
512
  }
516
513
 
517
- oCreation = oValidationCheck.then(function() {
514
+ oCreation = oValidationCheck.then(function () {
518
515
  if (!mParameters.parentControl) {
519
516
  mParameters.parentControl = that.getView();
520
517
  }
@@ -554,7 +551,7 @@ sap.ui.define(
554
551
  if (sProgrammingModel == ProgrammingModel.Sticky || mParameters.createAction) {
555
552
  mArgs.transient = true;
556
553
  }
557
- oNavigation = oCreation.then(function(oNewDocumentContext) {
554
+ oNavigation = oCreation.then(function (oNewDocumentContext) {
558
555
  if (!oNewDocumentContext) {
559
556
  var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core");
560
557
  return oRoutingListener.navigateToMessagePage(
@@ -577,7 +574,7 @@ sap.ui.define(
577
574
  // the creation row shall be cleared once the validation check was successful and
578
575
  // therefore the POST can be sent async to the backend
579
576
  oNavigation = oValidationCheck
580
- .then(function() {
577
+ .then(function () {
581
578
  var oCreationRowListBinding = oCreationRowContext.getBinding(),
582
579
  oNewTransientContext;
583
580
 
@@ -589,12 +586,12 @@ sap.ui.define(
589
586
  oCreationRow.setBindingContext(oNewTransientContext);
590
587
 
591
588
  // this is needed to avoid console errors TO be checked with model colleagues
592
- oNewTransientContext.created().catch(function() {
589
+ oNewTransientContext.created().catch(function () {
593
590
  Log.trace("transient fast creation context deleted");
594
591
  });
595
592
  return oCreationRowContext.delete("$direct");
596
593
  })
597
- .catch(function(oError) {
594
+ .catch(function (oError) {
598
595
  // Reset busy indicator after a validation error
599
596
  if (BusyLocker.isLocked(that.getView().getModel("ui"))) {
600
597
  BusyLocker.unlock(that.getView().getModel("ui"));
@@ -615,7 +612,7 @@ sap.ui.define(
615
612
  mParameters.creationMode !== CreationMode.Inline;
616
613
  if (oCreation) {
617
614
  return Promise.all([oCreation, oNavigation])
618
- .then(function(aParams) {
615
+ .then(function (aParams) {
619
616
  if (bIsNewPageCreation) {
620
617
  that._setEditMode(EditMode.Editable, bIsNewPageCreation);
621
618
  } else {
@@ -630,7 +627,7 @@ sap.ui.define(
630
627
  }
631
628
  }
632
629
  })
633
- .catch(function(oError) {
630
+ .catch(function (oError) {
634
631
  if (oError && oError.navigateBackFromTransientState) {
635
632
  oRoutingListener.navigateBackFromTransientState();
636
633
  }
@@ -640,13 +637,13 @@ sap.ui.define(
640
637
  }
641
638
  });
642
639
  })
643
- .finally(function() {
640
+ .finally(function () {
644
641
  if (oTable && oTable.isA("sap.ui.mdc.Table")) {
645
642
  var fnFocusOrScroll =
646
643
  mParameters.creationMode === CreationMode.Inline
647
644
  ? oTable.focusRow.bind(oTable)
648
645
  : oTable.scrollToIndex.bind(oTable);
649
- oTable.getRowBinding().attachEventOnce("change", function() {
646
+ oTable.getRowBinding().attachEventOnce("change", function () {
650
647
  switch (mParameters.createAtEnd) {
651
648
  case true:
652
649
  if (oTable.data("tableType") === "ResponsiveTable" && oTable.getThreshold()) {
@@ -681,7 +678,7 @@ sap.ui.define(
681
678
  * @experimental As of version 1.90.0
682
679
  * @since 1.90.0
683
680
  */
684
- onBeforeSave: function(mParameters) {
681
+ onBeforeSave: function (mParameters) {
685
682
  // to be overridden
686
683
  return Promise.resolve();
687
684
  },
@@ -702,7 +699,7 @@ sap.ui.define(
702
699
  * @experimental As of version 1.98.0
703
700
  * @since 1.98.0
704
701
  */
705
- onBeforeCreate: function(mParameters) {
702
+ onBeforeCreate: function (mParameters) {
706
703
  // to be overridden
707
704
  return Promise.resolve();
708
705
  },
@@ -722,7 +719,7 @@ sap.ui.define(
722
719
  * @experimental As of version 1.98.0
723
720
  * @since 1.98.0
724
721
  */
725
- onBeforeEdit: function(mParameters) {
722
+ onBeforeEdit: function (mParameters) {
726
723
  // to be overridden
727
724
  return Promise.resolve();
728
725
  },
@@ -742,7 +739,7 @@ sap.ui.define(
742
739
  * @experimental As of version 1.98.0
743
740
  * @since 1.98.0
744
741
  */
745
- onBeforeDiscard: function(mParameters) {
742
+ onBeforeDiscard: function (mParameters) {
746
743
  // to be overridden
747
744
  return Promise.resolve();
748
745
  },
@@ -762,7 +759,7 @@ sap.ui.define(
762
759
  * @experimental As of version 1.98.0
763
760
  * @since 1.98.0
764
761
  */
765
- onBeforeDelete: function(mParameters) {
762
+ onBeforeDelete: function (mParameters) {
766
763
  // to be overridden
767
764
  return Promise.resolve();
768
765
  },
@@ -784,7 +781,7 @@ sap.ui.define(
784
781
  * @public
785
782
  * @since 1.90.0
786
783
  */
787
- saveDocument: function(oContext, mParameters) {
784
+ saveDocument: function (oContext, mParameters) {
788
785
  mParameters = mParameters || {};
789
786
  var that = this,
790
787
  bExecuteSideEffectsOnError = mParameters.bExecuteSideEffectsOnError || undefined,
@@ -811,7 +808,7 @@ sap.ui.define(
811
808
  that._getMessageHandler()
812
809
  )
813
810
  )
814
- .then(function(oActiveDocumentContext) {
811
+ .then(function (oActiveDocumentContext) {
815
812
  var sProgrammingModel = that._getProgrammingModel(oContext);
816
813
 
817
814
  that._removeContextsFromPages();
@@ -827,14 +824,14 @@ sap.ui.define(
827
824
  that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation, true);
828
825
  }
829
826
  })
830
- .catch(function(oError) {
827
+ .catch(function (oError) {
831
828
  Log.error("Error while saving the document", oError);
832
829
  return Promise.reject(oError);
833
830
  })
834
831
  );
835
832
  },
836
833
 
837
- toggleDraftActive: function(oContext) {
834
+ toggleDraftActive: function (oContext) {
838
835
  var oContextData = oContext.getObject();
839
836
  var that = this;
840
837
  var bEditable;
@@ -864,19 +861,16 @@ sap.ui.define(
864
861
  }
865
862
  oToggleContext
866
863
  .requestCanonicalPath()
867
- .then(function(sCanonicalPath) {
864
+ .then(function (sCanonicalPath) {
868
865
  // We use the canonical path for the navigation instead of the semantic path, as the
869
866
  // semantic key values may have changed between the draft and the active version (BCP 2170216142)
870
- return oToggleContext
871
- .getModel()
872
- .bindContext(sCanonicalPath)
873
- .getBoundContext();
867
+ return oToggleContext.getModel().bindContext(sCanonicalPath).getBoundContext();
874
868
  })
875
- .then(function(oToggleContext) {
869
+ .then(function (oToggleContext) {
876
870
  that._setEditMode(bEditable ? EditMode.Editable : EditMode.Display, false); //switch to edit mode only if a draft is available
877
871
  that._handleNewContext(oToggleContext, bEditable, true, true, true);
878
872
  })
879
- .catch(function(err) {
873
+ .catch(function (err) {
880
874
  return Promise.reject("Error in EditFlow.toggleDraftActive:" + err);
881
875
  });
882
876
  },
@@ -898,7 +892,7 @@ sap.ui.define(
898
892
  * @public
899
893
  * @since 1.90.0
900
894
  */
901
- cancelDocument: function(oContext, mParameters) {
895
+ cancelDocument: function (oContext, mParameters) {
902
896
  var that = this,
903
897
  transactionHelper = this._getTransactionHelper(),
904
898
  oResourceBundle = that.getView().getController().oResourceBundle;
@@ -914,7 +908,7 @@ sap.ui.define(
914
908
  that._getMessageHandler()
915
909
  )
916
910
  )
917
- .then(function(oActiveDocumentContext) {
911
+ .then(function (oActiveDocumentContext) {
918
912
  var bDraftNavigation = true,
919
913
  sProgrammingModel = that._getProgrammingModel(oContext);
920
914
 
@@ -936,7 +930,7 @@ sap.ui.define(
936
930
  } else if (sProgrammingModel === ProgrammingModel.Draft) {
937
931
  // We need to load the semantic keys of the active context, as we need them
938
932
  // for the navigation
939
- return that._fetchSemanticKeyValues(oActiveDocumentContext).then(function() {
933
+ return that._fetchSemanticKeyValues(oActiveDocumentContext).then(function () {
940
934
  // We force the recreation of the context, so that it's created and bound in the same microtask,
941
935
  // so that all properties are loaded together by autoExpandSelect, so that when switching back to Edit mode
942
936
  // $$inheritExpandSelect takes all loaded properties into account (BCP 2070462265)
@@ -951,7 +945,7 @@ sap.ui.define(
951
945
  return that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation, true);
952
946
  }
953
947
  })
954
- .catch(function(oError) {
948
+ .catch(function (oError) {
955
949
  Log.error("Error while discarding the document", oError);
956
950
  });
957
951
  },
@@ -972,7 +966,7 @@ sap.ui.define(
972
966
  * @public
973
967
  * @since 1.90.0
974
968
  */
975
- deleteDocument: function(oContext, mParameters) {
969
+ deleteDocument: function (oContext, mParameters) {
976
970
  var that = this;
977
971
  var oAppComponent = CommonUtils.getAppComponent(that.getView());
978
972
  if (!mParameters) {
@@ -984,7 +978,7 @@ sap.ui.define(
984
978
  }
985
979
  mParameters.beforeDeleteCallBack = this.base.editFlow.onBeforeDelete;
986
980
  return this._deleteDocumentTransaction(oContext, mParameters)
987
- .then(function() {
981
+ .then(function () {
988
982
  // Single objet deletion is triggered from an OP header button (not from a list)
989
983
  // --> Mark UI dirty and navigate back to dismiss the OP
990
984
  EditState.setEditStateDirty();
@@ -995,7 +989,7 @@ sap.ui.define(
995
989
  oAppComponent.getShellServices().setBackNavigation();
996
990
  }
997
991
  })
998
- .catch(function(oError) {
992
+ .catch(function (oError) {
999
993
  Log.error("Error while deleting the document", oError);
1000
994
  });
1001
995
  },
@@ -1010,7 +1004,7 @@ sap.ui.define(
1010
1004
  * @public
1011
1005
  * @since 1.90.0
1012
1006
  */
1013
- applyDocument: function(oContext) {
1007
+ applyDocument: function (oContext) {
1014
1008
  var that = this,
1015
1009
  oLockObject = this._getGlobalUIModel();
1016
1010
  BusyLocker.lock(oLockObject);
@@ -1018,12 +1012,12 @@ sap.ui.define(
1018
1012
  this._submitOpenChanges(oContext)
1019
1013
  // check if there are any validation/parse errors
1020
1014
  .then(this._checkForValidationErrors.bind(this, oContext))
1021
- .then(function() {
1015
+ .then(function () {
1022
1016
  that._getMessageHandler().showMessageDialog();
1023
1017
  that._getRoutingListener().navigateBackFromContext(oContext);
1024
1018
  return true;
1025
1019
  })
1026
- .finally(function() {
1020
+ .finally(function () {
1027
1021
  if (BusyLocker.isLocked(oLockObject)) {
1028
1022
  BusyLocker.unlock(oLockObject);
1029
1023
  }
@@ -1053,7 +1047,7 @@ sap.ui.define(
1053
1047
  * @since 1.90.0
1054
1048
  * @final
1055
1049
  **/
1056
- invokeAction: function(sActionName, mParameters) {
1050
+ invokeAction: function (sActionName, mParameters) {
1057
1051
  var that = this,
1058
1052
  oControl,
1059
1053
  transactionHelper = this._getTransactionHelper(),
@@ -1155,11 +1149,7 @@ sap.ui.define(
1155
1149
  }
1156
1150
  }
1157
1151
 
1158
- if (mParameters.isNavigable) {
1159
- mParameters.bGetBoundContext = false;
1160
- } else {
1161
- mParameters.bGetBoundContext = true;
1162
- }
1152
+ mParameters.bGetBoundContext = this._getBoundContext(oView, mParameters);
1163
1153
  // Need to know that the action is called from ObjectPage for changeSet Isolated workaround
1164
1154
  mParameters.bObjectPage = oView.getViewData().converterType === "ObjectPage";
1165
1155
  return this._syncTask()
@@ -1172,18 +1162,18 @@ sap.ui.define(
1172
1162
  that._getMessageHandler()
1173
1163
  )
1174
1164
  )
1175
- .then(function(oResponse) {
1165
+ .then(function (oResponse) {
1176
1166
  // if the returned context for the bound action is different than the context on which action was called,
1177
1167
  // refresh the corresponding list binding
1178
1168
  if (mParameters.contexts) {
1179
1169
  return that
1180
1170
  ._refreshListIfRequired(that._getActionResponseDataAndKeys(sActionName, oResponse), mParameters.contexts[0])
1181
- .then(function() {
1171
+ .then(function () {
1182
1172
  return oResponse;
1183
1173
  });
1184
1174
  }
1185
1175
  })
1186
- .then(function(oResponse) {
1176
+ .then(function (oResponse) {
1187
1177
  if (oCurrentActionCallBacks) {
1188
1178
  oCurrentActionCallBacks.fResolver(oResponse);
1189
1179
  }
@@ -1225,7 +1215,7 @@ sap.ui.define(
1225
1215
  }
1226
1216
  }
1227
1217
  })
1228
- .catch(function(err) {
1218
+ .catch(function (err) {
1229
1219
  if (oCurrentActionCallBacks) {
1230
1220
  oCurrentActionCallBacks.fRejector();
1231
1221
  }
@@ -1253,7 +1243,7 @@ sap.ui.define(
1253
1243
  * @experimental As of version 1.90.0
1254
1244
  * @since 1.90.0
1255
1245
  */
1256
- securedExecution: function(fnFunction, mParameters) {
1246
+ securedExecution: function (fnFunction, mParameters) {
1257
1247
  var bBusySet = mParameters && mParameters.busy && mParameters.busy.set !== undefined ? mParameters.busy.set : true,
1258
1248
  bBusyCheck = mParameters && mParameters.busy && mParameters.busy.check !== undefined ? mParameters.busy.check : true,
1259
1249
  bUpdatesDocument = (mParameters && mParameters.updatesDocument) || false,
@@ -1277,7 +1267,7 @@ sap.ui.define(
1277
1267
  this._getMessageHandler().removeTransitionMessages();
1278
1268
 
1279
1269
  return this._syncTask(fnFunction)
1280
- .then(function() {
1270
+ .then(function () {
1281
1271
  if (bUpdatesDocument) {
1282
1272
  that._getTransactionHelper().handleDocumentModifications();
1283
1273
  EditState.setEditStateDirty();
@@ -1286,13 +1276,13 @@ sap.ui.define(
1286
1276
  }
1287
1277
  }
1288
1278
  })
1289
- .catch(function(oError) {
1279
+ .catch(function (oError) {
1290
1280
  if (bUpdatesDocument && bIsDraft) {
1291
1281
  that._setDraftStatus(DraftStatus.Clear);
1292
1282
  }
1293
1283
  return Promise.reject(oError);
1294
1284
  })
1295
- .finally(function() {
1285
+ .finally(function () {
1296
1286
  if (bBusySet) {
1297
1287
  BusyLocker.unlock(oLockObject);
1298
1288
  }
@@ -1305,11 +1295,11 @@ sap.ui.define(
1305
1295
  *
1306
1296
  * @param oEvent
1307
1297
  */
1308
- handlePatchSent: function(oEvent) {
1298
+ handlePatchSent: function (oEvent) {
1309
1299
  var that = this;
1310
1300
  this.mPatchPromises = this.mPatchPromises ? this.mPatchPromises : {};
1311
1301
  // do this for every unique object (eg: every table) so that each associated promise is fulfilled at the end
1312
- var oPatchPromise = new Promise(function(resolve, reject) {
1302
+ var oPatchPromise = new Promise(function (resolve, reject) {
1313
1303
  that.mPatchPromises[oEvent.getSource()] = {
1314
1304
  resolvePatchPromise: resolve,
1315
1305
  rejectPatchPromise: reject
@@ -1323,7 +1313,7 @@ sap.ui.define(
1323
1313
  *
1324
1314
  * @param oEvent
1325
1315
  */
1326
- handlePatchCompleted: function(oEvent) {
1316
+ handlePatchCompleted: function (oEvent) {
1327
1317
  var bSuccess = oEvent.getParameter("success");
1328
1318
  if (bSuccess) {
1329
1319
  this.mPatchPromises[oEvent.getSource()].resolvePatchPromise();
@@ -1344,74 +1334,44 @@ sap.ui.define(
1344
1334
 
1345
1335
  */
1346
1336
 
1347
- _setEditMode: function(sEditMode, bCreationMode) {
1348
- this.base
1349
- .getView()
1350
- .getController()
1351
- ._editFlow.setEditMode(sEditMode, bCreationMode);
1337
+ _setEditMode: function (sEditMode, bCreationMode) {
1338
+ this.base.getView().getController()._editFlow.setEditMode(sEditMode, bCreationMode);
1352
1339
  },
1353
1340
 
1354
- _setDraftStatus: function(sDraftState) {
1355
- this.base
1356
- .getView()
1357
- .getController()
1358
- ._editFlow.setDraftStatus(sDraftState);
1341
+ _setDraftStatus: function (sDraftState) {
1342
+ this.base.getView().getController()._editFlow.setDraftStatus(sDraftState);
1359
1343
  },
1360
1344
 
1361
- _getRoutingListener: function() {
1362
- return this.base
1363
- .getView()
1364
- .getController()
1365
- ._editFlow.getRoutingListener();
1345
+ _getRoutingListener: function () {
1346
+ return this.base.getView().getController()._editFlow.getRoutingListener();
1366
1347
  },
1367
1348
 
1368
- _getGlobalUIModel: function() {
1369
- return this.base
1370
- .getView()
1371
- .getController()
1372
- ._editFlow.getGlobalUIModel();
1349
+ _getGlobalUIModel: function () {
1350
+ return this.base.getView().getController()._editFlow.getGlobalUIModel();
1373
1351
  },
1374
1352
 
1375
- _syncTask: function(vTask) {
1376
- return this.base
1377
- .getView()
1378
- .getController()
1379
- ._editFlow.syncTask(vTask);
1353
+ _syncTask: function (vTask) {
1354
+ return this.base.getView().getController()._editFlow.syncTask(vTask);
1380
1355
  },
1381
1356
 
1382
- _getProgrammingModel: function(oContext) {
1383
- return this.base
1384
- .getView()
1385
- .getController()
1386
- ._editFlow.getProgrammingModel(oContext);
1357
+ _getProgrammingModel: function (oContext) {
1358
+ return this.base.getView().getController()._editFlow.getProgrammingModel(oContext);
1387
1359
  },
1388
1360
 
1389
- _deleteDocumentTransaction: function(oContext, mParameters) {
1390
- return this.base
1391
- .getView()
1392
- .getController()
1393
- ._editFlow.deleteDocumentTransaction(oContext, mParameters);
1361
+ _deleteDocumentTransaction: function (oContext, mParameters) {
1362
+ return this.base.getView().getController()._editFlow.deleteDocumentTransaction(oContext, mParameters);
1394
1363
  },
1395
1364
 
1396
- _handleCreateEvents: function(oBinding) {
1397
- this.base
1398
- .getView()
1399
- .getController()
1400
- ._editFlow.handleCreateEvents(oBinding);
1365
+ _handleCreateEvents: function (oBinding) {
1366
+ this.base.getView().getController()._editFlow.handleCreateEvents(oBinding);
1401
1367
  },
1402
1368
 
1403
- _getTransactionHelper: function() {
1404
- return this.base
1405
- .getView()
1406
- .getController()
1407
- ._editFlow.getTransactionHelper();
1369
+ _getTransactionHelper: function () {
1370
+ return this.base.getView().getController()._editFlow.getTransactionHelper();
1408
1371
  },
1409
1372
 
1410
- _getInternalModel: function() {
1411
- return this.base
1412
- .getView()
1413
- .getController()
1414
- ._editFlow.getInternalModel();
1373
+ _getInternalModel: function () {
1374
+ return this.base.getView().getController()._editFlow.getInternalModel();
1415
1375
  },
1416
1376
 
1417
1377
  /**
@@ -1424,32 +1384,20 @@ sap.ui.define(
1424
1384
  * @returns {Function} The resolver function which can be used to externally resolve the promise
1425
1385
  */
1426
1386
 
1427
- _createActionPromise: function(sActionName, sControlId) {
1428
- return this.base
1429
- .getView()
1430
- .getController()
1431
- ._editFlow.createActionPromise(sActionName, sControlId);
1387
+ _createActionPromise: function (sActionName, sControlId) {
1388
+ return this.base.getView().getController()._editFlow.createActionPromise(sActionName, sControlId);
1432
1389
  },
1433
1390
 
1434
- _getCurrentActionPromise: function() {
1435
- return this.base
1436
- .getView()
1437
- .getController()
1438
- ._editFlow.getCurrentActionPromise();
1391
+ _getCurrentActionPromise: function () {
1392
+ return this.base.getView().getController()._editFlow.getCurrentActionPromise();
1439
1393
  },
1440
1394
 
1441
- _deleteCurrentActionPromise: function() {
1442
- return this.base
1443
- .getView()
1444
- .getController()
1445
- ._editFlow.deleteCurrentActionPromise();
1395
+ _deleteCurrentActionPromise: function () {
1396
+ return this.base.getView().getController()._editFlow.deleteCurrentActionPromise();
1446
1397
  },
1447
1398
 
1448
- _getMessageHandler: function() {
1449
- return this.base
1450
- .getView()
1451
- .getController()
1452
- ._editFlow.getMessageHandler();
1399
+ _getMessageHandler: function () {
1400
+ return this.base.getView().getController()._editFlow.getMessageHandler();
1453
1401
  },
1454
1402
 
1455
1403
  /**
@@ -1460,61 +1408,46 @@ sap.ui.define(
1460
1408
  * @param {object} oResponse The bound action's response data or response context
1461
1409
  * @returns {object} Object with data and names of the key fields of the response
1462
1410
  */
1463
- _getActionResponseDataAndKeys: function(sActionName, oResponse) {
1464
- return this.base
1465
- .getView()
1466
- .getController()
1467
- ._editFlow.getActionResponseDataAndKeys(sActionName, oResponse);
1411
+ _getActionResponseDataAndKeys: function (sActionName, oResponse) {
1412
+ return this.base.getView().getController()._editFlow.getActionResponseDataAndKeys(sActionName, oResponse);
1468
1413
  },
1469
1414
 
1470
- _submitOpenChanges: function(oContext) {
1415
+ _submitOpenChanges: function (oContext) {
1471
1416
  var oModel = oContext.getModel(),
1472
1417
  oLockObject = this._getGlobalUIModel();
1473
1418
  //Currently we are using only 1 updateGroupId, hence submitting the batch directly here
1474
1419
  return oModel
1475
1420
  .submitBatch("$auto")
1476
- .then(function() {
1421
+ .then(function () {
1477
1422
  if (oModel.hasPendingChanges("$auto")) {
1478
1423
  // the submit was not successful
1479
1424
  return Promise.reject("submit of open changes failed");
1480
1425
  }
1481
1426
  })
1482
- .finally(function() {
1427
+ .finally(function () {
1483
1428
  if (BusyLocker.isLocked(oLockObject)) {
1484
1429
  BusyLocker.unlock(oLockObject);
1485
1430
  }
1486
1431
  });
1487
1432
  },
1488
1433
 
1489
- _handleStickyOn: function(oContext) {
1490
- return this.base
1491
- .getView()
1492
- .getController()
1493
- ._editFlow.handleStickyOn(oContext);
1434
+ _handleStickyOn: function (oContext) {
1435
+ return this.base.getView().getController()._editFlow.handleStickyOn(oContext);
1494
1436
  },
1495
1437
 
1496
- _handleStickyOff: function() {
1497
- return this.base
1498
- .getView()
1499
- .getController()
1500
- ._editFlow.handleStickyOff();
1438
+ _handleStickyOff: function () {
1439
+ return this.base.getView().getController()._editFlow.handleStickyOff();
1501
1440
  },
1502
1441
 
1503
- _onBackNavigationInSession: function() {
1504
- return this.base
1505
- .getView()
1506
- .getController()
1507
- ._editFlow.onBackNavigationInSession();
1442
+ _onBackNavigationInSession: function () {
1443
+ return this.base.getView().getController()._editFlow.onBackNavigationInSession();
1508
1444
  },
1509
1445
 
1510
- _discardStickySession: function(oContext) {
1511
- return this.base
1512
- .getView()
1513
- .getController()
1514
- ._editFlow.discardStickySession(oContext);
1446
+ _discardStickySession: function (oContext) {
1447
+ return this.base.getView().getController()._editFlow.discardStickySession(oContext);
1515
1448
  },
1516
1449
 
1517
- _handleNewContext: function(oContext, bEditable, bRecreateContext, bDraftNavigation, bForceFocus) {
1450
+ _handleNewContext: function (oContext, bEditable, bRecreateContext, bDraftNavigation, bForceFocus) {
1518
1451
  EditState.setEditStateDirty();
1519
1452
 
1520
1453
  return this._getRoutingListener().navigateToContext(oContext, {
@@ -1528,6 +1461,12 @@ sap.ui.define(
1528
1461
  });
1529
1462
  },
1530
1463
 
1464
+ _getBoundContext: function (oView, mParams) {
1465
+ var iViewLevel = oView.getViewData().viewLevel;
1466
+ var bRefreshAfterAction = iViewLevel > 1 || (iViewLevel === 1 && mParams.controlId);
1467
+ return !mParams.isNavigable || !!bRefreshAfterAction;
1468
+ },
1469
+
1531
1470
  /**
1532
1471
  * Checks if there are validation (parse) errors for controls bound to a given context
1533
1472
  *
@@ -1538,15 +1477,11 @@ sap.ui.define(
1538
1477
  * @returns {Promise} Promise resolves if there are no validation errors, and rejects if there are validation errors
1539
1478
  */
1540
1479
 
1541
- _checkForValidationErrors: function(oContext) {
1480
+ _checkForValidationErrors: function (oContext) {
1542
1481
  var that = this;
1543
- return this._syncTask().then(function() {
1482
+ return this._syncTask().then(function () {
1544
1483
  var sViewId = that.base.getView().getId();
1545
- var aMessages = sap.ui
1546
- .getCore()
1547
- .getMessageManager()
1548
- .getMessageModel()
1549
- .getData(),
1484
+ var aMessages = sap.ui.getCore().getMessageManager().getMessageModel().getData(),
1550
1485
  oControl,
1551
1486
  oMessage;
1552
1487
 
@@ -1577,7 +1512,7 @@ sap.ui.define(
1577
1512
  * @param {sap.ui.model.odata.v4.Context} oContext The bound context on which the action was executed
1578
1513
  * @returns {Promise} Always resolves to param oResponse
1579
1514
  */
1580
- _refreshListIfRequired: function(oResponse, oContext) {
1515
+ _refreshListIfRequired: function (oResponse, oContext) {
1581
1516
  if (!oContext || !oResponse || !oResponse.oData) {
1582
1517
  return Promise.resolve();
1583
1518
  }
@@ -1592,13 +1527,13 @@ sap.ui.define(
1592
1527
  // ensure context is in the response
1593
1528
  if (Object.keys(oContextData).length) {
1594
1529
  // check if context in response is different than the bound context
1595
- bReturnedContextIsSame = aKeys.every(function(sKey) {
1530
+ bReturnedContextIsSame = aKeys.every(function (sKey) {
1596
1531
  return oCurrentData[sKey] === oContextData[sKey];
1597
1532
  });
1598
1533
  if (!bReturnedContextIsSame) {
1599
- return new Promise(function(resolve, reject) {
1534
+ return new Promise(function (resolve, reject) {
1600
1535
  if (oBinding.isRoot()) {
1601
- oBinding.attachEventOnce("dataReceived", function() {
1536
+ oBinding.attachEventOnce("dataReceived", function () {
1602
1537
  resolve();
1603
1538
  });
1604
1539
  oBinding.refresh();
@@ -1608,15 +1543,15 @@ sap.ui.define(
1608
1543
  .getSideEffectsService()
1609
1544
  .requestSideEffects([{ $NavigationPropertyPath: oBinding.getPath() }], oBinding.getContext())
1610
1545
  .then(
1611
- function() {
1546
+ function () {
1612
1547
  resolve();
1613
1548
  },
1614
- function() {
1549
+ function () {
1615
1550
  Log.error("Error while refreshing the table");
1616
1551
  resolve();
1617
1552
  }
1618
1553
  )
1619
- .catch(function(e) {
1554
+ .catch(function (e) {
1620
1555
  Log.error("Error while refreshing the table", e);
1621
1556
  });
1622
1557
  }
@@ -1628,13 +1563,13 @@ sap.ui.define(
1628
1563
  return Promise.resolve();
1629
1564
  },
1630
1565
 
1631
- _fetchSemanticKeyValues: function(oContext) {
1566
+ _fetchSemanticKeyValues: function (oContext) {
1632
1567
  var oMetaModel = oContext.getModel().getMetaModel(),
1633
1568
  sEntitySetName = oMetaModel.getMetaContext(oContext.getPath()).getObject("@sapui.name"),
1634
1569
  aSemanticKeys = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
1635
1570
 
1636
1571
  if (aSemanticKeys && aSemanticKeys.length) {
1637
- var aRequestPromises = aSemanticKeys.map(function(oKey) {
1572
+ var aRequestPromises = aSemanticKeys.map(function (oKey) {
1638
1573
  return oContext.requestObject(oKey.$PropertyPath);
1639
1574
  });
1640
1575
 
@@ -1647,7 +1582,7 @@ sap.ui.define(
1647
1582
  // Ugly Workaround to overcome mdc field issue, we remove the binding context before
1648
1583
  // switching to display mode to avoid the field reads additional values for non existing
1649
1584
  // drafts or sticky sessions in the backend
1650
- _removeContextsFromPages: function() {
1585
+ _removeContextsFromPages: function () {
1651
1586
  var aPages = [];
1652
1587
  var oAppComponent = CommonUtils.getAppComponent(this.getView());
1653
1588
  if (oAppComponent._isFclEnabled()) {
@@ -1657,7 +1592,7 @@ sap.ui.define(
1657
1592
  aPages = oAppComponent.getRootContainer().getPages() || [];
1658
1593
  }
1659
1594
 
1660
- aPages.forEach(function(oPage) {
1595
+ aPages.forEach(function (oPage) {
1661
1596
  if (oPage.isA("sap.ui.core.ComponentContainer")) {
1662
1597
  oPage = oPage.getComponentInstance(); // The binding context is set at the component level, not the component container
1663
1598
  }