@sapui5/sap.fe.templates 1.94.0 → 1.96.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.
- package/package.json +1 -1
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/manifest.json +6 -0
- package/src/sap/fe/templates/ListComponent.js +1 -1
- package/src/sap/fe/templates/ListReport/Component.js +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +20 -5
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +3 -2
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +183 -170
- package/src/sap/fe/templates/ListReport/manifest.json +11 -1
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
- package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +124 -27
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +25 -5
- package/src/sap/fe/templates/ObjectPage/Component.js +1 -7
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +69 -60
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +154 -231
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +1 -1
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +1 -1
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -2
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -0
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +87 -63
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +23 -2
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +14 -11
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +26 -12
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +9 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +117 -116
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +63 -71
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +33 -22
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
- package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
- package/src/sap/fe/templates/TableScroller.js +61 -0
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +1 -0
- package/src/sap/fe/templates/library.js +2 -2
- package/src/sap/fe/templates/messagebundle.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ar.properties +2 -2
- package/src/sap/fe/templates/messagebundle_bg.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ca.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cs.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cy.properties +1 -1
- package/src/sap/fe/templates/messagebundle_da.properties +2 -2
- package/src/sap/fe/templates/messagebundle_de.properties +1 -1
- package/src/sap/fe/templates/messagebundle_el.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_GB.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +1 -1
- package/src/sap/fe/templates/messagebundle_es.properties +1 -1
- package/src/sap/fe/templates/messagebundle_es_MX.properties +1 -1
- package/src/sap/fe/templates/messagebundle_et.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_hr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hu.properties +1 -1
- package/src/sap/fe/templates/messagebundle_id.properties +1 -1
- package/src/sap/fe/templates/messagebundle_it.properties +1 -1
- package/src/sap/fe/templates/messagebundle_iw.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ja.properties +1 -1
- package/src/sap/fe/templates/messagebundle_kk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ko.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ms.properties +1 -1
- package/src/sap/fe/templates/messagebundle_nl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_no.properties +2 -2
- package/src/sap/fe/templates/messagebundle_pl.properties +2 -2
- package/src/sap/fe/templates/messagebundle_pt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ro.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ru.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sh.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sk.properties +2 -2
- package/src/sap/fe/templates/messagebundle_sl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_th.properties +2 -2
- package/src/sap/fe/templates/messagebundle_tr.properties +1 -1
- package/src/sap/fe/templates/messagebundle_uk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_vi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +2 -2
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
- package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.fragment.xml +0 -24
- package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
- package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
- package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
- package/src/sap/fe/templates/controls/Paginator.control.xml +0 -24
- package/src/sap/fe/templates/controls/Paginator.js +0 -173
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
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",
|
|
@@ -38,12 +37,15 @@ sap.ui.define(
|
|
|
38
37
|
"./overrides/Share",
|
|
39
38
|
"sap/fe/macros/DelegateUtil",
|
|
40
39
|
"sap/fe/macros/CommonHelper",
|
|
41
|
-
"sap/
|
|
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"
|
|
42
45
|
],
|
|
43
46
|
function(
|
|
44
47
|
PageController,
|
|
45
48
|
InternalRouting,
|
|
46
|
-
RoutingOverride,
|
|
47
49
|
InternalRoutingOverride,
|
|
48
50
|
SideEffects,
|
|
49
51
|
EditFlow,
|
|
@@ -75,7 +77,11 @@ sap.ui.define(
|
|
|
75
77
|
ShareOverrides,
|
|
76
78
|
DelegateUtil,
|
|
77
79
|
CommonHelper,
|
|
78
|
-
|
|
80
|
+
TableScroller,
|
|
81
|
+
JSONModel,
|
|
82
|
+
Paginator,
|
|
83
|
+
PaginatorOverride,
|
|
84
|
+
Placeholder
|
|
79
85
|
) {
|
|
80
86
|
"use strict";
|
|
81
87
|
|
|
@@ -93,21 +99,22 @@ sap.ui.define(
|
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
},
|
|
102
|
+
placeholder: Placeholder,
|
|
96
103
|
sideEffects: SideEffects,
|
|
97
104
|
editFlow: EditFlow,
|
|
98
105
|
share: Share.override(ShareOverrides),
|
|
99
106
|
_editFlow: InternalEditFlow.override(EditFlowOverrides),
|
|
100
107
|
_routing: InternalRouting.override(InternalRoutingOverride),
|
|
108
|
+
paginator: Paginator.override(PaginatorOverride),
|
|
101
109
|
messageHandler: MessageHandler.override(MessageHandlerOverride),
|
|
102
110
|
intentBasedNavigation: IntentBasedNavigation.override(IntentBasedNavigationOverride),
|
|
103
111
|
_intentBasedNavigation: InternalIntentBasedNavigation.override({
|
|
104
112
|
getNavigationMode: function() {
|
|
105
113
|
var bIsStickyEditMode =
|
|
106
114
|
this._oView.getController().getStickyEditMode && this._oView.getController().getStickyEditMode();
|
|
107
|
-
return bIsStickyEditMode ? "explace" :
|
|
115
|
+
return bIsStickyEditMode ? "explace" : undefined;
|
|
108
116
|
}
|
|
109
117
|
}),
|
|
110
|
-
routing: Routing.override(RoutingOverride),
|
|
111
118
|
viewState: ViewState.override(ViewStateOverrides),
|
|
112
119
|
pageReady: PageReady.override({
|
|
113
120
|
isContextExpected: function() {
|
|
@@ -161,11 +168,22 @@ sap.ui.define(
|
|
|
161
168
|
}
|
|
162
169
|
this.extensionAPI && this.extensionAPI.destroy();
|
|
163
170
|
delete this.extensionAPI;
|
|
171
|
+
|
|
172
|
+
var oMessageButton = this.getView().byId("fe::FooterBar::MessageButton"),
|
|
173
|
+
oMessagePopover = oMessageButton ? oMessageButton.oMessagePopover : null;
|
|
174
|
+
if (oMessagePopover && oMessagePopover.isOpen()) {
|
|
175
|
+
oMessagePopover.close();
|
|
176
|
+
}
|
|
164
177
|
},
|
|
165
178
|
|
|
166
179
|
_getTableBinding: function(oTable) {
|
|
167
180
|
return oTable && oTable.getRowBinding();
|
|
168
181
|
},
|
|
182
|
+
|
|
183
|
+
onBeforeRendering: function() {
|
|
184
|
+
PageController.prototype.onBeforeRendering.apply(this);
|
|
185
|
+
},
|
|
186
|
+
|
|
169
187
|
onAfterRendering: function(oEvent) {
|
|
170
188
|
var that = this;
|
|
171
189
|
this.getView()
|
|
@@ -187,7 +205,9 @@ sap.ui.define(
|
|
|
187
205
|
oObjectPage = this.byId("fe::ObjectPage"),
|
|
188
206
|
oBinding = mParameters.listBinding,
|
|
189
207
|
oInternalModelContext = that.getView().getBindingContext("internal"),
|
|
190
|
-
aBatchGroups = oInternalModelContext.getProperty("batchGroups")
|
|
208
|
+
aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
|
|
209
|
+
iViewLevel = this.getView().getViewData().viewLevel;
|
|
210
|
+
|
|
191
211
|
aBatchGroups.push("$auto");
|
|
192
212
|
if (mParameters.bDraftNavigation !== true) {
|
|
193
213
|
this._closeSideContent();
|
|
@@ -240,10 +260,9 @@ sap.ui.define(
|
|
|
240
260
|
});
|
|
241
261
|
|
|
242
262
|
//Set the Binding for Paginators using ListBinding ID
|
|
243
|
-
|
|
244
|
-
if (oBinding && oPaginator) {
|
|
263
|
+
if (oBinding && iViewLevel > 1) {
|
|
245
264
|
if (oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
246
|
-
|
|
265
|
+
this.paginator.initialize(oBinding, oContext);
|
|
247
266
|
} else {
|
|
248
267
|
//if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
|
|
249
268
|
// we need to create it
|
|
@@ -257,13 +276,12 @@ sap.ui.define(
|
|
|
257
276
|
oBinding.getContexts(0);
|
|
258
277
|
oBinding.attachEvent("change", function _setListBindingAsync() {
|
|
259
278
|
if (oBinding.getContexts().length > 0) {
|
|
260
|
-
|
|
279
|
+
that.paginator.initialize(oBinding, oContext);
|
|
261
280
|
oBinding.detachEvent("change", _setListBindingAsync);
|
|
262
281
|
}
|
|
263
282
|
});
|
|
264
283
|
}
|
|
265
284
|
}
|
|
266
|
-
|
|
267
285
|
if (oObjectPage.getEnableLazyLoading()) {
|
|
268
286
|
var aSections = oObjectPage.getSections(),
|
|
269
287
|
bUseIconTabBar = oObjectPage.getUseIconTabBar(),
|
|
@@ -277,11 +295,21 @@ sap.ui.define(
|
|
|
277
295
|
// In IconTabBar mode keep the second section bound if there is an editable header and we are switching to display mode
|
|
278
296
|
if (iSkip < 1 || (bUseIconTabBar && (iSection > 1 || (iSection === 1 && !bEditableHeader && !bIsInEditMode)))) {
|
|
279
297
|
var oSubSection = aSubSections[iSubSection];
|
|
280
|
-
oSubSection.
|
|
298
|
+
if (oSubSection.data().isVisibilityDynamic !== "true") {
|
|
299
|
+
oSubSection.setBindingContext(null);
|
|
300
|
+
}
|
|
281
301
|
}
|
|
282
302
|
}
|
|
283
303
|
}
|
|
284
304
|
}
|
|
305
|
+
|
|
306
|
+
if (this.placeholder.isPlaceholderEnabled() && mParameters.showPlaceholder) {
|
|
307
|
+
var oView = this.getView();
|
|
308
|
+
var oNavContainer = oView.getParent().oContainer.getParent();
|
|
309
|
+
if (oNavContainer) {
|
|
310
|
+
oNavContainer.showPlaceholder({});
|
|
311
|
+
}
|
|
312
|
+
}
|
|
285
313
|
},
|
|
286
314
|
|
|
287
315
|
_getFirstClickableElement: function(oObjectPage) {
|
|
@@ -289,7 +317,7 @@ sap.ui.define(
|
|
|
289
317
|
var aActions = oObjectPage.getHeaderTitle() && oObjectPage.getHeaderTitle().getActions();
|
|
290
318
|
if (aActions && aActions.length) {
|
|
291
319
|
oFirstClickableElement = aActions.find(function(oAction) {
|
|
292
|
-
return oAction.getVisible();
|
|
320
|
+
return oAction.getVisible() && oAction.getEnabled();
|
|
293
321
|
});
|
|
294
322
|
}
|
|
295
323
|
return oFirstClickableElement;
|
|
@@ -328,37 +356,28 @@ sap.ui.define(
|
|
|
328
356
|
return undefined;
|
|
329
357
|
},
|
|
330
358
|
|
|
331
|
-
|
|
332
|
-
|
|
359
|
+
_updateFocusInEditMode: function(aSubSections) {
|
|
360
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
361
|
+
|
|
362
|
+
var oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
|
|
363
|
+
var oFieldToFocus;
|
|
364
|
+
if (oMandatoryField) {
|
|
365
|
+
oFieldToFocus = oMandatoryField.content.getContentEdit()[0];
|
|
366
|
+
} else {
|
|
367
|
+
oFieldToFocus = oObjectPage._getFirstEditableInput() || this._getFirstClickableElement(oObjectPage);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (oFieldToFocus) {
|
|
371
|
+
setTimeout(function() {
|
|
372
|
+
// We set the focus in a timeeout, otherwise the focus sometimes goes to the TabBar
|
|
373
|
+
oFieldToFocus.focus();
|
|
374
|
+
}, 0);
|
|
375
|
+
}
|
|
333
376
|
},
|
|
334
377
|
|
|
335
378
|
_handleSubSectionEnteredViewPort: function(oEvent) {
|
|
336
379
|
var oSubSection = oEvent.getParameter("subSection");
|
|
337
|
-
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
338
380
|
oSubSection.setBindingContext(undefined);
|
|
339
|
-
var oObjectPage = this.byId("fe::ObjectPage");
|
|
340
|
-
if (oObjectPage.getModel("ui").getProperty("/editMode") !== "Display") {
|
|
341
|
-
if (
|
|
342
|
-
this.getView().getViewData().sectionLayout === "Tabs" &&
|
|
343
|
-
this.initialTab.value === false &&
|
|
344
|
-
oInternalModelContext.getProperty("errorNavigationSectionFlag") === false
|
|
345
|
-
) {
|
|
346
|
-
var oFieldToFocus = this._getFirstEmptyMandatoryFieldFromSubSection([oSubSection]);
|
|
347
|
-
if (oFieldToFocus) {
|
|
348
|
-
oFieldToFocus.content.getContentEdit()[0].focus();
|
|
349
|
-
} else {
|
|
350
|
-
var oFirstEditableInput = oObjectPage._getFirstEditableInput();
|
|
351
|
-
if (oFirstEditableInput) {
|
|
352
|
-
oFirstEditableInput.focus();
|
|
353
|
-
} else {
|
|
354
|
-
var oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
|
|
355
|
-
if (oFirstClickableElement) {
|
|
356
|
-
oFirstClickableElement.focus();
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
381
|
},
|
|
363
382
|
|
|
364
383
|
_onBackNavigationInDraft: function(oContext) {
|
|
@@ -384,14 +403,6 @@ sap.ui.define(
|
|
|
384
403
|
// binding with ownRequest
|
|
385
404
|
oBindingContext = oObjectPage.getBindingContext();
|
|
386
405
|
|
|
387
|
-
//Show popup while navigating back from object page in case of draft
|
|
388
|
-
if (oBindingContext) {
|
|
389
|
-
var bIsStickyMode = ModelHelper.isStickySessionSupported(oBindingContext.getModel().getMetaModel());
|
|
390
|
-
if (!bIsStickyMode) {
|
|
391
|
-
var oAppComponent = CommonUtils.getAppComponent(this.getView());
|
|
392
|
-
oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInDraft.bind(that, oBindingContext));
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
406
|
var aIBNActions = [];
|
|
396
407
|
oObjectPage.getSections().forEach(function(oSection) {
|
|
397
408
|
oSection.getSubSections().forEach(function(oSubSection) {
|
|
@@ -416,7 +427,6 @@ sap.ui.define(
|
|
|
416
427
|
}
|
|
417
428
|
}
|
|
418
429
|
// Workaround ends here!!
|
|
419
|
-
TableUtils.getSemanticTargetsFromTable(that, oTable);
|
|
420
430
|
|
|
421
431
|
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
422
432
|
// The same is also performed on Table selectionChange event
|
|
@@ -545,83 +555,61 @@ sap.ui.define(
|
|
|
545
555
|
},
|
|
546
556
|
onPageReady: function(mParameters) {
|
|
547
557
|
// Apply app state only after the page is ready with the first section selected
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
558
|
+
var that = this;
|
|
559
|
+
var oView = this.getView();
|
|
560
|
+
var oInternalModelContext = oView.getBindingContext("internal");
|
|
561
|
+
var oBindingContext = oView.getBindingContext();
|
|
562
|
+
//Show popup while navigating back from object page in case of draft
|
|
563
|
+
if (oBindingContext) {
|
|
564
|
+
var bIsStickyMode = ModelHelper.isStickySessionSupported(oBindingContext.getModel().getMetaModel());
|
|
565
|
+
if (!bIsStickyMode) {
|
|
566
|
+
var oAppComponent = CommonUtils.getAppComponent(oView);
|
|
567
|
+
oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInDraft.bind(that, oBindingContext));
|
|
555
568
|
}
|
|
556
|
-
return aVisibleSections;
|
|
557
569
|
}
|
|
558
|
-
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
559
|
-
|
|
560
570
|
this.getAppComponent()
|
|
561
571
|
.getAppStateHandler()
|
|
562
572
|
.applyAppState();
|
|
563
|
-
var oLastFocusedControl = mParameters.lastFocusedControl;
|
|
564
|
-
if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
|
|
565
|
-
var oView = this.getView();
|
|
566
|
-
var oFocusControl = oView.byId(oLastFocusedControl.controlId);
|
|
567
|
-
if (oFocusControl) {
|
|
568
|
-
oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
var oObjectPage = this.byId("fe::ObjectPage");
|
|
573
|
-
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
574
|
-
var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
|
|
575
|
-
var oFirstClickableElement;
|
|
576
|
-
var aVisibleSections = getVisibleSections(oObjectPage);
|
|
577
573
|
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
//Focus on first mandatory empty field
|
|
574
|
+
if (mParameters.forceFocus) {
|
|
575
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
576
|
+
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
577
|
+
var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
|
|
578
|
+
var aVisibleSections = oObjectPage.getSections().filter(function(oSection) {
|
|
579
|
+
return oSection.getVisible() === true;
|
|
580
|
+
});
|
|
581
|
+
// Select the first visible section
|
|
587
582
|
oObjectPage.setSelectedSection(aVisibleSections[0].getId());
|
|
588
|
-
if (
|
|
589
|
-
this.getView().getViewData().sectionLayout === "Page" ||
|
|
590
|
-
(this.getView().getViewData().sectionLayout === "Tabs" && this.initialTab.value === true)
|
|
591
|
-
) {
|
|
592
|
-
var oFieldToFocus;
|
|
593
|
-
var aSubSections = [];
|
|
594
|
-
for (var section = 0; section < aVisibleSections.length; section++) {
|
|
595
|
-
aSubSections = aVisibleSections[section].getSubSections();
|
|
596
|
-
oFieldToFocus = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
|
|
597
|
-
if (oFieldToFocus) {
|
|
598
|
-
oFieldToFocus.content.getContentEdit()[0].focus();
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
583
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
584
|
+
if (isInDisplayMode) {
|
|
585
|
+
var oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
|
|
586
|
+
if (oFirstClickableElement) {
|
|
587
|
+
oFirstClickableElement.focus();
|
|
588
|
+
}
|
|
589
|
+
} else {
|
|
590
|
+
var aVisibleSubSections;
|
|
591
|
+
if (oView.getViewData().sectionLayout === "Tabs") {
|
|
592
|
+
// In a tabbed layout, only the subsections of the selected section are visible on the screen
|
|
593
|
+
aVisibleSubSections = aVisibleSections[0].getSubSections();
|
|
609
594
|
} else {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
595
|
+
// In a paged layout, all subsections of the visible sections are visible on the screen
|
|
596
|
+
aVisibleSubSections = aVisibleSections
|
|
597
|
+
.map(function(oSection) {
|
|
598
|
+
return oSection.getSubSections();
|
|
599
|
+
})
|
|
600
|
+
.flat();
|
|
614
601
|
}
|
|
602
|
+
this._updateFocusInEditMode(aVisibleSubSections);
|
|
615
603
|
}
|
|
616
|
-
this.initialTab.value = false;
|
|
617
604
|
}
|
|
605
|
+
|
|
618
606
|
oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
|
|
619
607
|
this._checkDataPointTitleForExternalNavigation();
|
|
620
608
|
},
|
|
621
609
|
/**
|
|
622
|
-
* Get
|
|
610
|
+
* Get the status of edit mode for sticky session.
|
|
623
611
|
*
|
|
624
|
-
* @returns {boolean}
|
|
612
|
+
* @returns {boolean} The status of edit mode for sticky session
|
|
625
613
|
*
|
|
626
614
|
*
|
|
627
615
|
*/
|
|
@@ -636,6 +624,11 @@ sap.ui.define(
|
|
|
636
624
|
}
|
|
637
625
|
return bIsStickyEditMode;
|
|
638
626
|
},
|
|
627
|
+
|
|
628
|
+
_getObjectPageLayoutControl: function() {
|
|
629
|
+
return this.byId("fe::ObjectPage");
|
|
630
|
+
},
|
|
631
|
+
|
|
639
632
|
_getPageTitleInformation: function() {
|
|
640
633
|
var oObjectPage = this.byId("fe::ObjectPage");
|
|
641
634
|
var oObjectPageSubtitle = oObjectPage.getCustomData().find(function(oCustomData) {
|
|
@@ -774,18 +767,19 @@ sap.ui.define(
|
|
|
774
767
|
);
|
|
775
768
|
}
|
|
776
769
|
});
|
|
777
|
-
return Promise.all(aWaitCreateDocuments)
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
.saveDocument(oContext, mParameters)
|
|
784
|
-
|
|
785
|
-
|
|
770
|
+
return Promise.all(aWaitCreateDocuments)
|
|
771
|
+
.then(function(aBindings) {
|
|
772
|
+
var mParameters = {
|
|
773
|
+
bExecuteSideEffectsOnError: bExecuteSideEffectsOnError,
|
|
774
|
+
bindings: aBindings
|
|
775
|
+
};
|
|
776
|
+
return that.editFlow.saveDocument(oContext, mParameters).catch(that._showMessagePopover.bind(that));
|
|
777
|
+
})
|
|
778
|
+
.finally(function() {
|
|
779
|
+
if (BusyLocker.isLocked(oModel)) {
|
|
786
780
|
BusyLocker.unlock(oModel);
|
|
787
|
-
}
|
|
788
|
-
|
|
781
|
+
}
|
|
782
|
+
});
|
|
789
783
|
},
|
|
790
784
|
|
|
791
785
|
_cancelDocument: function(oContext, mParameters) {
|
|
@@ -909,90 +903,7 @@ sap.ui.define(
|
|
|
909
903
|
},
|
|
910
904
|
|
|
911
905
|
/**
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
* @function
|
|
915
|
-
* @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_getTableRow
|
|
916
|
-
* @param {object} oTableRowBindingContexts 'contexts of the table rows'
|
|
917
|
-
* @param {string} sRowPath 'sPath of the table row'
|
|
918
|
-
* @returns {object} row satisfying the criterias passed in parameter
|
|
919
|
-
*/
|
|
920
|
-
|
|
921
|
-
_getTableRow: function(oTableRowBindingContexts, sRowPath) {
|
|
922
|
-
if (
|
|
923
|
-
oTableRowBindingContexts.filter(function(item) {
|
|
924
|
-
return item !== undefined;
|
|
925
|
-
}).length > 0
|
|
926
|
-
) {
|
|
927
|
-
var oTableRow = oTableRowBindingContexts.find(function(item) {
|
|
928
|
-
return item.getPath().indexOf(sRowPath) !== -1;
|
|
929
|
-
});
|
|
930
|
-
return oTableRow;
|
|
931
|
-
} else {
|
|
932
|
-
return undefined;
|
|
933
|
-
}
|
|
934
|
-
},
|
|
935
|
-
|
|
936
|
-
/**
|
|
937
|
-
* Scroll the table to the Row that has the corresponding sPath
|
|
938
|
-
*
|
|
939
|
-
* @function
|
|
940
|
-
* @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTableToRow
|
|
941
|
-
* @param {object} oTable 'table to be scrolled'
|
|
942
|
-
* @param {string} sRowPath 'sPath of the table row'
|
|
943
|
-
*
|
|
944
|
-
*/
|
|
945
|
-
|
|
946
|
-
_scrollTableToRow: function(oTable, sRowPath) {
|
|
947
|
-
var oTableRowBinding = oTable.getRowBinding();
|
|
948
|
-
var that = this;
|
|
949
|
-
var pWait = new Promise(function(resolve, reject) {
|
|
950
|
-
if (oTableRowBinding) {
|
|
951
|
-
var oTableRowBindingContexts;
|
|
952
|
-
switch (oTable.data().tableType) {
|
|
953
|
-
case "GridTable":
|
|
954
|
-
oTableRowBindingContexts = oTableRowBinding.getContexts(0);
|
|
955
|
-
break;
|
|
956
|
-
case "ResponsiveTable":
|
|
957
|
-
oTableRowBindingContexts = oTableRowBinding.getCurrentContexts();
|
|
958
|
-
break;
|
|
959
|
-
default:
|
|
960
|
-
}
|
|
961
|
-
//wait for the bindingContexts to be ready when a view enters/goes out of FCL fullscreen :
|
|
962
|
-
if (
|
|
963
|
-
oTableRowBindingContexts.filter(function(item) {
|
|
964
|
-
return item === undefined;
|
|
965
|
-
}).length > 0 ||
|
|
966
|
-
oTableRowBindingContexts.length === 0
|
|
967
|
-
) {
|
|
968
|
-
oTableRowBinding.attachChange(function getTableRowCallBack(oEvent) {
|
|
969
|
-
var oTableRowBindingContexts = that._getTableRow(oEvent.getSource().getCurrentContexts(), sRowPath);
|
|
970
|
-
if (oTableRowBindingContexts) {
|
|
971
|
-
oTableRowBinding.detachChange(getTableRowCallBack);
|
|
972
|
-
resolve(oTableRowBindingContexts);
|
|
973
|
-
}
|
|
974
|
-
});
|
|
975
|
-
} else {
|
|
976
|
-
resolve(that._getTableRow(oTableRowBindingContexts, sRowPath));
|
|
977
|
-
}
|
|
978
|
-
} else {
|
|
979
|
-
reject();
|
|
980
|
-
}
|
|
981
|
-
});
|
|
982
|
-
pWait
|
|
983
|
-
.then(function(oTableRow) {
|
|
984
|
-
if (oTableRow) {
|
|
985
|
-
var iPos = oTableRow.iIndex;
|
|
986
|
-
oTable.scrollToIndex(iPos);
|
|
987
|
-
}
|
|
988
|
-
})
|
|
989
|
-
.catch(function() {
|
|
990
|
-
Log.warning("Could not find any matched row");
|
|
991
|
-
});
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
/**
|
|
995
|
-
* Scroll the Tables to the Row with the sPath
|
|
906
|
+
* Scroll the tables to the row with the sPath
|
|
996
907
|
*
|
|
997
908
|
* @function
|
|
998
909
|
* @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTablesToRow
|
|
@@ -1004,7 +915,7 @@ sap.ui.define(
|
|
|
1004
915
|
if (this._findTables && this._findTables().length > 0) {
|
|
1005
916
|
var aTables = this._findTables();
|
|
1006
917
|
for (var i = 0; i < aTables.length; i++) {
|
|
1007
|
-
|
|
918
|
+
TableScroller.scrollTableToRow(aTables[i], sRowPath);
|
|
1008
919
|
}
|
|
1009
920
|
}
|
|
1010
921
|
},
|
|
@@ -1123,7 +1034,7 @@ sap.ui.define(
|
|
|
1123
1034
|
var oTitleHierarchyCache = oRootViewController.getTitleHierarchyCache();
|
|
1124
1035
|
var pWaitForTitleHiearchyInfo;
|
|
1125
1036
|
var sParameterPath = oMetaModel.getMetaPath(sPath);
|
|
1126
|
-
var bResultContext = oMetaModel.
|
|
1037
|
+
var bResultContext = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
|
|
1127
1038
|
if (bResultContext) {
|
|
1128
1039
|
// We dont need to create a breadcrumb for Parameter path
|
|
1129
1040
|
iSkipParameterized = 1;
|
|
@@ -1351,7 +1262,8 @@ sap.ui.define(
|
|
|
1351
1262
|
.getModel()
|
|
1352
1263
|
.getMetaModel()
|
|
1353
1264
|
.getMetaPath(oDataPointOrChartBindingContext.getPath()),
|
|
1354
|
-
aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath)
|
|
1265
|
+
aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath),
|
|
1266
|
+
additionalNavigationParameters;
|
|
1355
1267
|
|
|
1356
1268
|
aNavigationData = aNavigationData.map(function(oNavigationData) {
|
|
1357
1269
|
return {
|
|
@@ -1359,45 +1271,56 @@ sap.ui.define(
|
|
|
1359
1271
|
metaPath: sMetaPath + (sCollectionPath ? "/" + sCollectionPath : "")
|
|
1360
1272
|
};
|
|
1361
1273
|
});
|
|
1274
|
+
if (oTargetInfo && oTargetInfo.parameters) {
|
|
1275
|
+
var oParams =
|
|
1276
|
+
oTargetInfo.parameters && oController._intentBasedNavigation.getOutboundParams(oTargetInfo.parameters);
|
|
1277
|
+
if (Object.keys(oParams).length > 0) {
|
|
1278
|
+
additionalNavigationParameters = oParams;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1362
1281
|
if (oTargetInfo && oTargetInfo.semanticObject && oTargetInfo.action) {
|
|
1363
1282
|
oController._intentBasedNavigation.navigate(oTargetInfo.semanticObject, oTargetInfo.action, {
|
|
1364
1283
|
navigationContexts: aNavigationData,
|
|
1365
|
-
semanticObjectMapping: aSemanticObjectMapping
|
|
1284
|
+
semanticObjectMapping: aSemanticObjectMapping,
|
|
1285
|
+
additionalNavigationParameters: additionalNavigationParameters
|
|
1366
1286
|
});
|
|
1367
1287
|
}
|
|
1368
1288
|
},
|
|
1369
1289
|
/**
|
|
1370
|
-
* Triggers an outbound navigation
|
|
1290
|
+
* Triggers an outbound navigation when a user chooses the chevron.
|
|
1371
1291
|
*
|
|
1372
|
-
* @param oController
|
|
1292
|
+
* @param {object} oController
|
|
1373
1293
|
* @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
|
|
1374
|
-
* @param {sap.ui.model.odata.v4.Context} oContext
|
|
1294
|
+
* @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
|
|
1295
|
+
* @param {string} sCreatePath Create path when the chevron is created.
|
|
1375
1296
|
* @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
|
|
1297
|
+
* @ui5-restricted
|
|
1298
|
+
* @final
|
|
1376
1299
|
*/
|
|
1377
|
-
onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext) {
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
oContext = oContext && oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context") ? [oContext] : oContext;
|
|
1385
|
-
oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
|
|
1386
|
-
navigationContexts: oContext
|
|
1387
|
-
});
|
|
1388
|
-
|
|
1389
|
-
//TODO: check why returning a promise is required
|
|
1390
|
-
// If there is no reason for the promise then this function can be removed
|
|
1391
|
-
// and instead intentBasedNavigation.navigate can be directly used.
|
|
1392
|
-
return Promise.resolve();
|
|
1393
|
-
} else {
|
|
1394
|
-
throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
|
|
1395
|
-
}
|
|
1300
|
+
onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
|
|
1301
|
+
return oController._intentBasedNavigation.onChevronPressNavigateOutBound(
|
|
1302
|
+
oController,
|
|
1303
|
+
sOutboundTarget,
|
|
1304
|
+
oContext,
|
|
1305
|
+
sCreatePath
|
|
1306
|
+
);
|
|
1396
1307
|
},
|
|
1308
|
+
|
|
1397
1309
|
onNavigateChange: function(oEvent) {
|
|
1398
1310
|
//will be called always when we click on a section tab
|
|
1399
1311
|
this.getExtensionAPI().updateAppState();
|
|
1400
1312
|
this.bSectionNavigated = true;
|
|
1313
|
+
|
|
1314
|
+
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
1315
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
1316
|
+
if (
|
|
1317
|
+
oObjectPage.getModel("ui").getProperty("/editMode") !== "Display" &&
|
|
1318
|
+
this.getView().getViewData().sectionLayout === "Tabs" &&
|
|
1319
|
+
oInternalModelContext.getProperty("errorNavigationSectionFlag") === false
|
|
1320
|
+
) {
|
|
1321
|
+
var oSubSection = oEvent.getParameter("subSection");
|
|
1322
|
+
this._updateFocusInEditMode([oSubSection]);
|
|
1323
|
+
}
|
|
1401
1324
|
},
|
|
1402
1325
|
onVariantSelected: function(oEvent) {
|
|
1403
1326
|
this.getExtensionAPI().updateAppState();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
sap.ui.define(["sap/uxap/BlockBase"], function(BlockBase) {
|
|
@@ -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
|
-
|
|
12
|
+
columnLayout: { type: "sap.uxap.BlockBaseColumnLayout", group: "Behavior", defaultValue: 4 }
|
|
13
13
|
},
|
|
14
14
|
aggregations: {
|
|
15
15
|
content: {
|