@sapui5/sap.fe.templates 1.93.3 → 1.97.0

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.
Files changed (95) hide show
  1. package/package.json +7 -4
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/manifest.json +6 -0
  4. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +31 -3
  5. package/src/sap/fe/templates/ListReport/ListReport.view.xml +9 -7
  6. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +244 -229
  7. package/src/sap/fe/templates/ListReport/manifest.json +11 -1
  8. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +2 -6
  9. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +151 -28
  10. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
  11. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +35 -99
  12. package/src/sap/fe/templates/ObjectPage/Component.js +15 -4
  13. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +18 -3
  14. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +169 -165
  15. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +262 -170
  16. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +8 -0
  17. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +1 -1
  18. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -0
  19. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +2 -2
  20. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +42 -1
  21. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +16 -14
  22. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +20 -8
  23. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +14 -19
  24. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
  25. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
  26. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
  27. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
  28. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
  29. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +8 -2
  30. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +8 -4
  31. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +117 -115
  32. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +113 -99
  33. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +32 -21
  34. package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
  35. package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
  36. package/src/sap/fe/templates/TableScroller.js +61 -0
  37. package/src/sap/fe/templates/controls/Chart.fragment.xml +11 -14
  38. package/src/sap/fe/templates/controls/Table.fragment.xml +3 -0
  39. package/src/sap/fe/templates/library.js +1 -1
  40. package/src/sap/fe/templates/messagebundle.properties +1 -1
  41. package/src/sap/fe/templates/messagebundle_ar.properties +9 -5
  42. package/src/sap/fe/templates/messagebundle_bg.properties +8 -4
  43. package/src/sap/fe/templates/messagebundle_ca.properties +8 -4
  44. package/src/sap/fe/templates/messagebundle_cs.properties +7 -3
  45. package/src/sap/fe/templates/messagebundle_cy.properties +8 -4
  46. package/src/sap/fe/templates/messagebundle_da.properties +9 -5
  47. package/src/sap/fe/templates/messagebundle_de.properties +8 -4
  48. package/src/sap/fe/templates/messagebundle_el.properties +8 -4
  49. package/src/sap/fe/templates/messagebundle_en.properties +7 -3
  50. package/src/sap/fe/templates/messagebundle_en_GB.properties +7 -3
  51. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +7 -3
  52. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
  53. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
  54. package/src/sap/fe/templates/messagebundle_es.properties +8 -4
  55. package/src/sap/fe/templates/messagebundle_es_MX.properties +8 -4
  56. package/src/sap/fe/templates/messagebundle_et.properties +7 -3
  57. package/src/sap/fe/templates/messagebundle_fi.properties +8 -4
  58. package/src/sap/fe/templates/messagebundle_fr.properties +9 -5
  59. package/src/sap/fe/templates/messagebundle_fr_CA.properties +8 -4
  60. package/src/sap/fe/templates/messagebundle_hi.properties +8 -4
  61. package/src/sap/fe/templates/messagebundle_hr.properties +8 -4
  62. package/src/sap/fe/templates/messagebundle_hu.properties +9 -5
  63. package/src/sap/fe/templates/messagebundle_id.properties +10 -6
  64. package/src/sap/fe/templates/messagebundle_it.properties +8 -4
  65. package/src/sap/fe/templates/messagebundle_iw.properties +8 -4
  66. package/src/sap/fe/templates/messagebundle_ja.properties +8 -4
  67. package/src/sap/fe/templates/messagebundle_kk.properties +8 -4
  68. package/src/sap/fe/templates/messagebundle_ko.properties +8 -4
  69. package/src/sap/fe/templates/messagebundle_lt.properties +8 -4
  70. package/src/sap/fe/templates/messagebundle_lv.properties +8 -4
  71. package/src/sap/fe/templates/messagebundle_ms.properties +8 -4
  72. package/src/sap/fe/templates/messagebundle_nl.properties +8 -4
  73. package/src/sap/fe/templates/messagebundle_no.properties +9 -5
  74. package/src/sap/fe/templates/messagebundle_pl.properties +8 -4
  75. package/src/sap/fe/templates/messagebundle_pt.properties +8 -4
  76. package/src/sap/fe/templates/messagebundle_pt_PT.properties +8 -4
  77. package/src/sap/fe/templates/messagebundle_ro.properties +8 -4
  78. package/src/sap/fe/templates/messagebundle_ru.properties +9 -5
  79. package/src/sap/fe/templates/messagebundle_sh.properties +8 -4
  80. package/src/sap/fe/templates/messagebundle_sk.properties +8 -4
  81. package/src/sap/fe/templates/messagebundle_sl.properties +8 -4
  82. package/src/sap/fe/templates/messagebundle_sv.properties +8 -4
  83. package/src/sap/fe/templates/messagebundle_th.properties +9 -5
  84. package/src/sap/fe/templates/messagebundle_tr.properties +7 -3
  85. package/src/sap/fe/templates/messagebundle_uk.properties +7 -3
  86. package/src/sap/fe/templates/messagebundle_vi.properties +8 -4
  87. package/src/sap/fe/templates/messagebundle_zh_CN.properties +9 -5
  88. package/src/sap/fe/templates/messagebundle_zh_TW.properties +8 -4
  89. package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
  90. package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.fragment.xml +0 -24
  91. package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
  92. package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
  93. package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
  94. package/src/sap/fe/templates/controls/Paginator.control.xml +0 -22
  95. package/src/sap/fe/templates/controls/Paginator.js +0 -173
@@ -6,7 +6,6 @@ sap.ui.define(
6
6
  [
7
7
  "sap/fe/core/PageController",
8
8
  "sap/fe/core/controllerextensions/InternalRouting",
9
- "./overrides/Routing",
10
9
  "./overrides/InternalRouting",
11
10
  "sap/fe/core/controllerextensions/SideEffects",
12
11
  "sap/fe/core/controllerextensions/EditFlow",
@@ -37,12 +36,16 @@ sap.ui.define(
37
36
  "sap/fe/core/controllerextensions/Share",
38
37
  "./overrides/Share",
39
38
  "sap/fe/macros/DelegateUtil",
40
- "sap/fe/macros/CommonHelper"
39
+ "sap/fe/macros/CommonHelper",
40
+ "sap/fe/templates/TableScroller",
41
+ "sap/ui/model/json/JSONModel",
42
+ "sap/fe/core/controllerextensions/Paginator",
43
+ "./overrides/Paginator",
44
+ "sap/fe/core/controllerextensions/Placeholder"
41
45
  ],
42
46
  function(
43
47
  PageController,
44
48
  InternalRouting,
45
- RoutingOverride,
46
49
  InternalRoutingOverride,
47
50
  SideEffects,
48
51
  EditFlow,
@@ -73,7 +76,12 @@ sap.ui.define(
73
76
  Share,
74
77
  ShareOverrides,
75
78
  DelegateUtil,
76
- CommonHelper
79
+ CommonHelper,
80
+ TableScroller,
81
+ JSONModel,
82
+ Paginator,
83
+ PaginatorOverride,
84
+ Placeholder
77
85
  ) {
78
86
  "use strict";
79
87
 
@@ -91,11 +99,13 @@ sap.ui.define(
91
99
  }
92
100
  }
93
101
  },
102
+ placeholder: Placeholder,
94
103
  sideEffects: SideEffects,
95
104
  editFlow: EditFlow,
96
105
  share: Share.override(ShareOverrides),
97
106
  _editFlow: InternalEditFlow.override(EditFlowOverrides),
98
107
  _routing: InternalRouting.override(InternalRoutingOverride),
108
+ paginator: Paginator.override(PaginatorOverride),
99
109
  messageHandler: MessageHandler.override(MessageHandlerOverride),
100
110
  intentBasedNavigation: IntentBasedNavigation.override(IntentBasedNavigationOverride),
101
111
  _intentBasedNavigation: InternalIntentBasedNavigation.override({
@@ -105,7 +115,6 @@ sap.ui.define(
105
115
  return bIsStickyEditMode ? "explace" : "inplace";
106
116
  }
107
117
  }),
108
- routing: Routing.override(RoutingOverride),
109
118
  viewState: ViewState.override(ViewStateOverrides),
110
119
  pageReady: PageReady.override({
111
120
  isContextExpected: function() {
@@ -142,7 +151,7 @@ sap.ui.define(
142
151
  items: null
143
152
  });
144
153
  oInternalModelContext.setProperty("batchGroups", this._getBatchGroupsForView());
145
-
154
+ oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
146
155
  if (oObjectPage.getEnableLazyLoading()) {
147
156
  //Attaching the event to make the subsection context binding active when it is visible.
148
157
  oObjectPage.attachEvent("subSectionEnteredViewPort", this._handleSubSectionEnteredViewPort.bind(this));
@@ -170,6 +179,11 @@ sap.ui.define(
170
179
  _getTableBinding: function(oTable) {
171
180
  return oTable && oTable.getRowBinding();
172
181
  },
182
+
183
+ onBeforeRendering: function() {
184
+ PageController.prototype.onBeforeRendering.apply(this);
185
+ },
186
+
173
187
  onAfterRendering: function(oEvent) {
174
188
  var that = this;
175
189
  this.getView()
@@ -191,7 +205,9 @@ sap.ui.define(
191
205
  oObjectPage = this.byId("fe::ObjectPage"),
192
206
  oBinding = mParameters.listBinding,
193
207
  oInternalModelContext = that.getView().getBindingContext("internal"),
194
- aBatchGroups = oInternalModelContext.getProperty("batchGroups");
208
+ aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
209
+ iViewLevel = this.getView().getViewData().viewLevel;
210
+
195
211
  aBatchGroups.push("$auto");
196
212
  if (mParameters.bDraftNavigation !== true) {
197
213
  this._closeSideContent();
@@ -244,13 +260,28 @@ sap.ui.define(
244
260
  });
245
261
 
246
262
  //Set the Binding for Paginators using ListBinding ID
247
- if (oBinding && oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
248
- var oPaginator = that.byId("fe::Paginator");
249
- if (oPaginator) {
250
- oPaginator.setListBinding(oBinding);
263
+ if (oBinding && iViewLevel > 1) {
264
+ if (oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
265
+ this.paginator.initialize(oBinding, oContext);
266
+ } else {
267
+ //if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
268
+ // we need to create it
269
+ var sContextPath = oBinding.getPath().replace(/\([^\)]*\)*$/, ""); //removing the last tuple
270
+ var oBinding = new sap.ui.model.odata.v4.ODataListBinding(
271
+ oBinding.oModel,
272
+ "",
273
+ oBinding.oModel.createBindingContext(sContextPath)
274
+ );
275
+
276
+ oBinding.getContexts(0);
277
+ oBinding.attachEvent("change", function _setListBindingAsync() {
278
+ if (oBinding.getContexts().length > 0) {
279
+ that.paginator.initialize(oBinding, oContext);
280
+ oBinding.detachEvent("change", _setListBindingAsync);
281
+ }
282
+ });
251
283
  }
252
284
  }
253
-
254
285
  if (oObjectPage.getEnableLazyLoading()) {
255
286
  var aSections = oObjectPage.getSections(),
256
287
  bUseIconTabBar = oObjectPage.getUseIconTabBar(),
@@ -269,6 +300,77 @@ sap.ui.define(
269
300
  }
270
301
  }
271
302
  }
303
+
304
+ if (this.placeholder.isPlaceholderEnabled() && mParameters.showPlaceholder) {
305
+ var oView = this.getView();
306
+ var oNavContainer = oView.getParent().oContainer.getParent();
307
+ if (oNavContainer) {
308
+ oNavContainer.showPlaceholder({});
309
+ }
310
+ }
311
+ },
312
+
313
+ _getFirstClickableElement: function(oObjectPage) {
314
+ var oFirstClickableElement;
315
+ var aActions = oObjectPage.getHeaderTitle() && oObjectPage.getHeaderTitle().getActions();
316
+ if (aActions && aActions.length) {
317
+ oFirstClickableElement = aActions.find(function(oAction) {
318
+ return oAction.getVisible() && oAction.getEnabled();
319
+ });
320
+ }
321
+ return oFirstClickableElement;
322
+ },
323
+
324
+ _getFirstEmptyMandatoryFieldFromSubSection: function(aSubSections) {
325
+ for (var subSection = 0; aSubSections && subSection < aSubSections.length; subSection++) {
326
+ var aBlocks = aSubSections[subSection].getBlocks();
327
+
328
+ for (var block = 0; aBlocks && block < aBlocks.length; block++) {
329
+ var aFormContainers;
330
+
331
+ if (aBlocks[block].isA("sap.ui.layout.form.Form")) {
332
+ aFormContainers = aBlocks[block].getFormContainers();
333
+ } else if (
334
+ aBlocks[block].getContent &&
335
+ aBlocks[block].getContent() &&
336
+ aBlocks[block].getContent().isA("sap.ui.layout.form.Form")
337
+ ) {
338
+ aFormContainers = aBlocks[block].getContent().getFormContainers();
339
+ }
340
+
341
+ for (var formContainer = 0; aFormContainers && formContainer < aFormContainers.length; formContainer++) {
342
+ var aFormElements = aFormContainers[formContainer].getFormElements();
343
+
344
+ for (var formElement = 0; aFormElements && formElement < aFormElements.length; formElement++) {
345
+ var aFields = aFormElements[formElement].getFields();
346
+
347
+ if (aFields[0].getRequired() && !aFields[0].getValue()) {
348
+ return aFields[0];
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ return undefined;
355
+ },
356
+
357
+ _updateFocusInEditMode: function(aSubSections) {
358
+ var oObjectPage = this.byId("fe::ObjectPage");
359
+
360
+ var oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
361
+ var oFieldToFocus;
362
+ if (oMandatoryField) {
363
+ oFieldToFocus = oMandatoryField.content.getContentEdit()[0];
364
+ } else {
365
+ oFieldToFocus = oObjectPage._getFirstEditableInput() || this._getFirstClickableElement(oObjectPage);
366
+ }
367
+
368
+ if (oFieldToFocus) {
369
+ setTimeout(function() {
370
+ // We set the focus in a timeeout, otherwise the focus sometimes goes to the TabBar
371
+ oFieldToFocus.focus();
372
+ }, 0);
373
+ }
272
374
  },
273
375
 
274
376
  _handleSubSectionEnteredViewPort: function(oEvent) {
@@ -291,7 +393,8 @@ sap.ui.define(
291
393
  _onAfterBinding: function(oBindingContext, mParameters) {
292
394
  var oObjectPage = this.byId("fe::ObjectPage"),
293
395
  that = this,
294
- aTables = this._findTables();
396
+ aTables = this._findTables(),
397
+ aFormContainers = this._findFormContainers();
295
398
 
296
399
  this.sideEffects.clearPropertiesStatus();
297
400
 
@@ -299,20 +402,38 @@ sap.ui.define(
299
402
  // binding with ownRequest
300
403
  oBindingContext = oObjectPage.getBindingContext();
301
404
 
302
- //Show popup while navigating back from object page in case of draft
303
- if (oBindingContext) {
304
- var bIsStickyMode = ModelHelper.isStickySessionSupported(oBindingContext.getModel().getMetaModel());
305
- if (!bIsStickyMode) {
306
- var oAppComponent = CommonUtils.getAppComponent(this.getView());
307
- oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInDraft.bind(that, oBindingContext));
308
- }
309
- }
310
405
  var aIBNActions = [];
311
406
  oObjectPage.getSections().forEach(function(oSection) {
312
407
  oSection.getSubSections().forEach(function(oSubSection) {
313
408
  aIBNActions = CommonUtils.getIBNActions(oSubSection, aIBNActions);
314
409
  });
315
410
  });
411
+
412
+ // Assign internal binding contexts to oFormContainer:
413
+ // 1. It is not possible to assign the internal binding context to the XML fragment
414
+ // (FormContainer.fragment.xml) yet - it is used already for the data-structure.
415
+ // 2. Another problem is, that FormContainers assigned to a 'MoreBlock' does not have an
416
+ // internal model context at all.
417
+
418
+ aFormContainers.forEach(function(oFormContainer) {
419
+ var oInternalModelContext,
420
+ oInternalModel = oObjectPage.getModel("internal"),
421
+ sPageContextPath = "/pages/" + that.getView().getId(),
422
+ sFormContainerContextPath = "controls/" + that.getView().getLocalId(oFormContainer.getId()),
423
+ SHOW_DETAILS = "showDetails";
424
+ if (oFormContainer.getModel("internal") === undefined) {
425
+ oFormContainer.setModel(oInternalModel, "internal");
426
+ oFormContainer.setBindingContext(
427
+ oInternalModel.createBindingContext(sPageContextPath + "/" + sFormContainerContextPath),
428
+ "internal"
429
+ );
430
+ oFormContainer.bindElement({ path: "", model: "internal" });
431
+ } else {
432
+ oFormContainer.bindElement({ path: sFormContainerContextPath, model: "internal" });
433
+ }
434
+ oInternalModelContext = oFormContainer.getBindingContext("internal");
435
+ oInternalModelContext.setProperty(SHOW_DETAILS, false);
436
+ });
316
437
  aTables.forEach(function(oTable) {
317
438
  var oInternalModelContext = oTable.getBindingContext("internal");
318
439
  oInternalModelContext.setProperty("creationRowFieldValidity", {});
@@ -331,7 +452,6 @@ sap.ui.define(
331
452
  }
332
453
  }
333
454
  // Workaround ends here!!
334
- TableUtils.getSemanticTargetsFromTable(that, oTable);
335
455
 
336
456
  // Update 'enabled' property of DataFieldForAction buttons on table toolbar
337
457
  // The same is also performed on Table selectionChange event
@@ -458,48 +578,63 @@ sap.ui.define(
458
578
  oObjectPage._triggerVisibleSubSectionsEvents();
459
579
  }
460
580
  },
461
-
462
581
  onPageReady: function(mParameters) {
463
582
  // Apply app state only after the page is ready with the first section selected
583
+ var that = this;
584
+ var oView = this.getView();
585
+ var oInternalModelContext = oView.getBindingContext("internal");
586
+ var oBindingContext = oView.getBindingContext();
587
+ //Show popup while navigating back from object page in case of draft
588
+ if (oBindingContext) {
589
+ var bIsStickyMode = ModelHelper.isStickySessionSupported(oBindingContext.getModel().getMetaModel());
590
+ if (!bIsStickyMode) {
591
+ var oAppComponent = CommonUtils.getAppComponent(oView);
592
+ oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInDraft.bind(that, oBindingContext));
593
+ }
594
+ }
464
595
  this.getAppComponent()
465
596
  .getAppStateHandler()
466
597
  .applyAppState();
467
- var oLastFocusedControl = mParameters.lastFocusedControl;
468
- if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
469
- var oView = this.getView();
470
- var oFocusControl = oView.byId(oLastFocusedControl.controlId);
471
- if (oFocusControl) {
472
- oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
473
- return;
474
- }
475
- }
476
- var oObjectPage = this.byId("fe::ObjectPage");
477
- // set the focus to the first action button, or to the first editable input if in editable mode
478
- var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
479
- var firstElementClickable;
480
- if (isInDisplayMode) {
481
- var aActions = oObjectPage.getHeaderTitle() && oObjectPage.getHeaderTitle().getActions();
482
- if (aActions && aActions.length) {
483
- firstElementClickable = aActions.find(function(action) {
484
- // do we need && action.mProperties["enabled"] ?
485
- return action.mProperties["visible"];
486
- });
487
- if (firstElementClickable) {
488
- firstElementClickable.focus();
598
+
599
+ if (mParameters.forceFocus) {
600
+ var oObjectPage = this.byId("fe::ObjectPage");
601
+ // set the focus to the first action button, or to the first editable input if in editable mode
602
+ var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
603
+ var aVisibleSections = oObjectPage.getSections().filter(function(oSection) {
604
+ return oSection.getVisible() === true;
605
+ });
606
+ // Select the first visible section
607
+ oObjectPage.setSelectedSection(aVisibleSections[0].getId());
608
+
609
+ if (isInDisplayMode) {
610
+ var oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
611
+ if (oFirstClickableElement) {
612
+ oFirstClickableElement.focus();
489
613
  }
490
- }
491
- } else {
492
- var firstEditableInput = oObjectPage._getFirstEditableInput();
493
- if (firstEditableInput) {
494
- firstEditableInput.focus();
614
+ } else {
615
+ var aVisibleSubSections;
616
+ if (oView.getViewData().sectionLayout === "Tabs") {
617
+ // In a tabbed layout, only the subsections of the selected section are visible on the screen
618
+ aVisibleSubSections = aVisibleSections[0].getSubSections();
619
+ } else {
620
+ // In a paged layout, all subsections of the visible sections are visible on the screen
621
+ aVisibleSubSections = aVisibleSections
622
+ .map(function(oSection) {
623
+ return oSection.getSubSections();
624
+ })
625
+ .flat();
626
+ }
627
+ this._updateFocusInEditMode(aVisibleSubSections);
495
628
  }
496
629
  }
630
+
631
+ oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
497
632
  this._checkDataPointTitleForExternalNavigation();
498
633
  },
499
634
  /**
500
- * Get sticky edit mode.
635
+ * Get the status of edit mode for sticky session.
501
636
  *
502
- * @returns {boolean} Sticky edit mode status
637
+ * @returns {boolean} The status of edit mode for sticky session
503
638
  *
504
639
  *
505
640
  */
@@ -514,6 +649,11 @@ sap.ui.define(
514
649
  }
515
650
  return bIsStickyEditMode;
516
651
  },
652
+
653
+ _getObjectPageLayoutControl: function() {
654
+ return this.byId("fe::ObjectPage");
655
+ },
656
+
517
657
  _getPageTitleInformation: function() {
518
658
  var oObjectPage = this.byId("fe::ObjectPage");
519
659
  var oObjectPageSubtitle = oObjectPage.getCustomData().find(function(oCustomData) {
@@ -661,7 +801,9 @@ sap.ui.define(
661
801
  .saveDocument(oContext, mParameters)
662
802
  .catch(that._showMessagePopover.bind(that))
663
803
  .finally(function() {
664
- BusyLocker.unlock(oModel);
804
+ if (BusyLocker.isLocked(oModel)) {
805
+ BusyLocker.unlock(oModel);
806
+ }
665
807
  });
666
808
  });
667
809
  },
@@ -744,6 +886,37 @@ sap.ui.define(
744
886
  return aBlocks;
745
887
  },
746
888
 
889
+ _findFormContainers: function() {
890
+ var aSubSections = this._getAllSubSections(),
891
+ aFormContainers = [];
892
+
893
+ function _collectFormContainersInBlocks(aBlocks) {
894
+ for (var i = 0; i < aBlocks.length; i++) {
895
+ var oElement = aBlocks[i].getContent instanceof Function && aBlocks[i].getContent();
896
+ if (oElement && oElement.isA && oElement.isA("sap.ui.layout.DynamicSideContent")) {
897
+ oElement = oElement.getMainContent instanceof Function && oElement.getMainContent();
898
+ if (oElement && oElement.length > 0) {
899
+ oElement = oElement[0];
900
+ }
901
+ }
902
+ if (
903
+ oElement &&
904
+ oElement.isA &&
905
+ oElement.isA("sap.ui.layout.form.Form") &&
906
+ oElement.getFormContainers instanceof Function
907
+ ) {
908
+ aFormContainers = aFormContainers.concat(oElement.getFormContainers());
909
+ }
910
+ }
911
+ }
912
+
913
+ for (var i = 0; i < aSubSections.length; i++) {
914
+ _collectFormContainersInBlocks(aSubSections[i].getBlocks());
915
+ _collectFormContainersInBlocks(aSubSections[i].getMoreBlocks());
916
+ }
917
+ return aFormContainers;
918
+ },
919
+
747
920
  //TODO: This is needed for two workarounds - to be removed again
748
921
  _findTables: function() {
749
922
  var aSubSections = this._getAllSubSections(),
@@ -787,90 +960,7 @@ sap.ui.define(
787
960
  },
788
961
 
789
962
  /**
790
- * Get the Row that has the corresponding binding context
791
- *
792
- * @function
793
- * @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_getTableRow
794
- * @param {object} oTableRowBindingContexts 'contexts of the table rows'
795
- * @param {string} sRowPath 'sPath of the table row'
796
- * @returns {object} row satisfying the criterias passed in parameter
797
- */
798
-
799
- _getTableRow: function(oTableRowBindingContexts, sRowPath) {
800
- if (
801
- oTableRowBindingContexts.filter(function(item) {
802
- return item !== undefined;
803
- }).length > 0
804
- ) {
805
- var oTableRow = oTableRowBindingContexts.find(function(item) {
806
- return item.getPath().indexOf(sRowPath) !== -1;
807
- });
808
- return oTableRow;
809
- } else {
810
- return undefined;
811
- }
812
- },
813
-
814
- /**
815
- * Scroll the table to the Row that has the corresponding sPath
816
- *
817
- * @function
818
- * @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTableToRow
819
- * @param {object} oTable 'table to be scrolled'
820
- * @param {string} sRowPath 'sPath of the table row'
821
- *
822
- */
823
-
824
- _scrollTableToRow: function(oTable, sRowPath) {
825
- var oTableRowBinding = oTable.getRowBinding();
826
- var that = this;
827
- var pWait = new Promise(function(resolve, reject) {
828
- if (oTableRowBinding) {
829
- var oTableRowBindingContexts;
830
- switch (oTable.data().tableType) {
831
- case "GridTable":
832
- oTableRowBindingContexts = oTableRowBinding.getContexts(0);
833
- break;
834
- case "ResponsiveTable":
835
- oTableRowBindingContexts = oTableRowBinding.getCurrentContexts();
836
- break;
837
- default:
838
- }
839
- //wait for the bindingContexts to be ready when a view enters/goes out of FCL fullscreen :
840
- if (
841
- oTableRowBindingContexts.filter(function(item) {
842
- return item === undefined;
843
- }).length > 0 ||
844
- oTableRowBindingContexts.length === 0
845
- ) {
846
- oTableRowBinding.attachChange(function getTableRowCallBack(oEvent) {
847
- var oTableRowBindingContexts = that._getTableRow(oEvent.getSource().getCurrentContexts(), sRowPath);
848
- if (oTableRowBindingContexts) {
849
- oTableRowBinding.detachChange(getTableRowCallBack);
850
- resolve(oTableRowBindingContexts);
851
- }
852
- });
853
- } else {
854
- resolve(that._getTableRow(oTableRowBindingContexts, sRowPath));
855
- }
856
- } else {
857
- reject();
858
- }
859
- });
860
- pWait
861
- .then(function(oTableRow) {
862
- if (oTableRow) {
863
- var iPos = oTableRow.iIndex;
864
- oTable.scrollToIndex(iPos);
865
- }
866
- })
867
- .catch(function() {
868
- Log.warning("Could not find any matched row");
869
- });
870
- },
871
-
872
- /**
873
- * Scroll the Tables to the Row with the sPath
963
+ * Scroll the tables to the row with the sPath
874
964
  *
875
965
  * @function
876
966
  * @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTablesToRow
@@ -882,7 +972,7 @@ sap.ui.define(
882
972
  if (this._findTables && this._findTables().length > 0) {
883
973
  var aTables = this._findTables();
884
974
  for (var i = 0; i < aTables.length; i++) {
885
- this._scrollTableToRow(aTables[i], sRowPath);
975
+ TableScroller.scrollTableToRow(aTables[i], sRowPath);
886
976
  }
887
977
  }
888
978
  },
@@ -1001,7 +1091,7 @@ sap.ui.define(
1001
1091
  var oTitleHierarchyCache = oRootViewController.getTitleHierarchyCache();
1002
1092
  var pWaitForTitleHiearchyInfo;
1003
1093
  var sParameterPath = oMetaModel.getMetaPath(sPath);
1004
- var bResultContext = oMetaModel.getProperty(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
1094
+ var bResultContext = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
1005
1095
  if (bResultContext) {
1006
1096
  // We dont need to create a breadcrumb for Parameter path
1007
1097
  iSkipParameterized = 1;
@@ -1195,11 +1285,6 @@ sap.ui.define(
1195
1285
  Log.error("An error occurs while scrolling to the newly created Item: " + err);
1196
1286
  });
1197
1287
  }
1198
- // fire DataStateChange whenever there is a table context change to update row highlighting
1199
- var oDataStateIndicator = oTable.getDataStateIndicator();
1200
- if (oDataStateIndicator.getFilter()(null, oTable)) {
1201
- oDataStateIndicator.fireDataStateChange();
1202
- }
1203
1288
  // fire ModelContextChange on the message button whenever the table context changes
1204
1289
  var oMessageButton = that.getView().byId("fe::FooterBar::MessageButton");
1205
1290
  oMessageButton.fireModelContextChange();
@@ -1234,7 +1319,8 @@ sap.ui.define(
1234
1319
  .getModel()
1235
1320
  .getMetaModel()
1236
1321
  .getMetaPath(oDataPointOrChartBindingContext.getPath()),
1237
- aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath);
1322
+ aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath),
1323
+ additionalNavigationParameters;
1238
1324
 
1239
1325
  aNavigationData = aNavigationData.map(function(oNavigationData) {
1240
1326
  return {
@@ -1242,50 +1328,56 @@ sap.ui.define(
1242
1328
  metaPath: sMetaPath + (sCollectionPath ? "/" + sCollectionPath : "")
1243
1329
  };
1244
1330
  });
1331
+ if (oTargetInfo && oTargetInfo.parameters) {
1332
+ var oParams =
1333
+ oTargetInfo.parameters && oController._intentBasedNavigation.getOutboundParams(oTargetInfo.parameters);
1334
+ if (Object.keys(oParams).length > 0) {
1335
+ additionalNavigationParameters = oParams;
1336
+ }
1337
+ }
1245
1338
  if (oTargetInfo && oTargetInfo.semanticObject && oTargetInfo.action) {
1246
1339
  oController._intentBasedNavigation.navigate(oTargetInfo.semanticObject, oTargetInfo.action, {
1247
1340
  navigationContexts: aNavigationData,
1248
- semanticObjectMapping: aSemanticObjectMapping
1341
+ semanticObjectMapping: aSemanticObjectMapping,
1342
+ additionalNavigationParameters: additionalNavigationParameters
1249
1343
  });
1250
1344
  }
1251
1345
  },
1252
1346
  /**
1253
1347
  * Triggers an outbound navigation when a user chooses the chevron.
1254
1348
  *
1255
- * @param oController
1349
+ * @param {object} oController
1256
1350
  * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
1257
- <<<<<<< HEAD (2310ec [INTERNAL] Release notes for version 1.93.1)
1258
- * @param {sap.ui.model.odata.v4.Context} oContext That contain the data for the target app
1259
- =======
1260
1351
  * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
1261
1352
  * @param {string} sCreatePath Create path when the chevron is created.
1262
- >>>>>>> CHANGE (657783 [FIX] The message popover controls are now closed when leavi)
1263
1353
  * @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
1354
+ * @ui5-restricted
1355
+ * @final
1264
1356
  */
1265
- onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext) {
1266
- var oOutbounds = oController
1267
- .getAppComponent()
1268
- .getRoutingService()
1269
- .getOutbounds(),
1270
- oDisplayOutbound = oOutbounds[sOutboundTarget];
1271
- if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
1272
- oContext = oContext && oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context") ? [oContext] : oContext;
1273
- oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
1274
- navigationContexts: oContext
1275
- });
1276
-
1277
- //TODO: check why returning a promise is required
1278
- // If there is no reason for the promise then this function can be removed
1279
- // and instead intentBasedNavigation.navigate can be directly used.
1280
- return Promise.resolve();
1281
- } else {
1282
- throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
1283
- }
1357
+ onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
1358
+ return oController._intentBasedNavigation.onChevronPressNavigateOutBound(
1359
+ oController,
1360
+ sOutboundTarget,
1361
+ oContext,
1362
+ sCreatePath
1363
+ );
1284
1364
  },
1365
+
1285
1366
  onNavigateChange: function(oEvent) {
1286
1367
  //will be called always when we click on a section tab
1287
1368
  this.getExtensionAPI().updateAppState();
1288
1369
  this.bSectionNavigated = true;
1370
+
1371
+ var oInternalModelContext = this.getView().getBindingContext("internal");
1372
+ var oObjectPage = this.byId("fe::ObjectPage");
1373
+ if (
1374
+ oObjectPage.getModel("ui").getProperty("/editMode") !== "Display" &&
1375
+ this.getView().getViewData().sectionLayout === "Tabs" &&
1376
+ oInternalModelContext.getProperty("errorNavigationSectionFlag") === false
1377
+ ) {
1378
+ var oSubSection = oEvent.getParameter("subSection");
1379
+ this._updateFocusInEditMode([oSubSection]);
1380
+ }
1289
1381
  },
1290
1382
  onVariantSelected: function(oEvent) {
1291
1383
  this.getExtensionAPI().updateAppState();
@@ -67,6 +67,7 @@ sap.ui.define(
67
67
  */
68
68
  StashableHBox.prototype.getTitleControl = function() {
69
69
  var aItems = [],
70
+ content,
70
71
  i;
71
72
  if (this.getItems && this.getItems()[0] && this.getItems()[0].getItems) {
72
73
  aItems = this.getItems()[0].getItems();
@@ -75,6 +76,13 @@ sap.ui.define(
75
76
  }
76
77
  for (i = 0; i < aItems.length; i++) {
77
78
  if (aItems[i].isA("sap.m.Title") || aItems[i].isA("sap.m.Link")) {
79
+ if (aItems[i].isA("sap.m.Title")) {
80
+ // If a title was found, check if there is a link in the content aggregation
81
+ content = aItems[i].getContent();
82
+ if (content && content.isA("sap.m.Link")) {
83
+ return content;
84
+ }
85
+ }
78
86
  return aItems[i];
79
87
  }
80
88
  }
@@ -9,7 +9,7 @@ sap.ui.define(["sap/uxap/BlockBase"], function(BlockBase) {
9
9
  var SubSectionBlock = BlockBase.extend("sap.fe.templates.ObjectPage.controls.SubSectionBlock", {
10
10
  metadata: {
11
11
  properties: {
12
- "columnLayout": { type: "sap.uxap.BlockBaseColumnLayout", group: "Behavior", defaultValue: 4 }
12
+ columnLayout: { type: "sap.uxap.BlockBaseColumnLayout", group: "Behavior", defaultValue: 4 }
13
13
  },
14
14
  aggregations: {
15
15
  content: {
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * SAPUI5
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
+ */
5
+ sap.ui.define([], function() {
6
+ "use strict";
7
+ return {
8
+ onContextUpdate: function(oContext) {
9
+ var that = this;
10
+ that.base._routing.navigateToContext(oContext, { callExtension: true });
11
+ }
12
+ };
13
+ });