@sapui5/sap.fe.templates 1.95.0 → 1.98.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.
- package/package.json +6 -3
- 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 +3 -3
- 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 +1 -1
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +6 -4
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +136 -85
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
- package/src/sap/fe/templates/ListReport/overrides/MassEdit.js +95 -0
- package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +166 -33
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +23 -3
- package/src/sap/fe/templates/ObjectPage/Component.js +31 -18
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +16 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +103 -88
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +235 -174
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +9 -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 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +89 -72
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +10 -6
- 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 +2 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +24 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +181 -0
- 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 +111 -8
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +88 -32
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +161 -144
- 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 +1 -1
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +2 -0
- package/src/sap/fe/templates/library.js +2 -2
- package/src/sap/fe/templates/messagebundle.properties +25 -2
- package/src/sap/fe/templates/messagebundle_ar.properties +1 -1
- 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 +1 -1
- 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 +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -2
- package/src/sap/fe/templates/messagebundle_es.properties +9 -9
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/sap/fe/templates/messagebundle_tr.properties +2 -2
- 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 +1 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderImage.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
|
@@ -1,13 +1,12 @@
|
|
|
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
9
|
"./overrides/InternalRouting",
|
|
10
|
-
"sap/fe/core/controllerextensions/SideEffects",
|
|
11
10
|
"sap/fe/core/controllerextensions/EditFlow",
|
|
12
11
|
"sap/fe/core/controllerextensions/InternalEditFlow",
|
|
13
12
|
"sap/fe/core/controllerextensions/PageReady",
|
|
@@ -41,13 +40,14 @@ sap.ui.define(
|
|
|
41
40
|
"sap/ui/model/json/JSONModel",
|
|
42
41
|
"sap/fe/core/controllerextensions/Paginator",
|
|
43
42
|
"./overrides/Paginator",
|
|
44
|
-
"sap/fe/core/controllerextensions/Placeholder"
|
|
43
|
+
"sap/fe/core/controllerextensions/Placeholder",
|
|
44
|
+
"sap/base/util/UriParameters",
|
|
45
|
+
"sap/fe/core/controllerextensions/MassEdit"
|
|
45
46
|
],
|
|
46
47
|
function(
|
|
47
48
|
PageController,
|
|
48
49
|
InternalRouting,
|
|
49
50
|
InternalRoutingOverride,
|
|
50
|
-
SideEffects,
|
|
51
51
|
EditFlow,
|
|
52
52
|
InternalEditFlow,
|
|
53
53
|
PageReady,
|
|
@@ -81,7 +81,9 @@ sap.ui.define(
|
|
|
81
81
|
JSONModel,
|
|
82
82
|
Paginator,
|
|
83
83
|
PaginatorOverride,
|
|
84
|
-
Placeholder
|
|
84
|
+
Placeholder,
|
|
85
|
+
UriParameters,
|
|
86
|
+
MassEdit
|
|
85
87
|
) {
|
|
86
88
|
"use strict";
|
|
87
89
|
|
|
@@ -100,7 +102,6 @@ sap.ui.define(
|
|
|
100
102
|
}
|
|
101
103
|
},
|
|
102
104
|
placeholder: Placeholder,
|
|
103
|
-
sideEffects: SideEffects,
|
|
104
105
|
editFlow: EditFlow,
|
|
105
106
|
share: Share.override(ShareOverrides),
|
|
106
107
|
_editFlow: InternalEditFlow.override(EditFlowOverrides),
|
|
@@ -112,7 +113,7 @@ sap.ui.define(
|
|
|
112
113
|
getNavigationMode: function() {
|
|
113
114
|
var bIsStickyEditMode =
|
|
114
115
|
this._oView.getController().getStickyEditMode && this._oView.getController().getStickyEditMode();
|
|
115
|
-
return bIsStickyEditMode ? "explace" :
|
|
116
|
+
return bIsStickyEditMode ? "explace" : undefined;
|
|
116
117
|
}
|
|
117
118
|
}),
|
|
118
119
|
viewState: ViewState.override(ViewStateOverrides),
|
|
@@ -121,6 +122,7 @@ sap.ui.define(
|
|
|
121
122
|
return true;
|
|
122
123
|
}
|
|
123
124
|
}),
|
|
125
|
+
massEdit: MassEdit,
|
|
124
126
|
|
|
125
127
|
getExtensionAPI: function(sId) {
|
|
126
128
|
if (sId) {
|
|
@@ -152,7 +154,7 @@ sap.ui.define(
|
|
|
152
154
|
});
|
|
153
155
|
oInternalModelContext.setProperty("batchGroups", this._getBatchGroupsForView());
|
|
154
156
|
oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
|
|
155
|
-
if (oObjectPage.getEnableLazyLoading()) {
|
|
157
|
+
if (!this.getView().getViewData().useNewLazyLoading && oObjectPage.getEnableLazyLoading()) {
|
|
156
158
|
//Attaching the event to make the subsection context binding active when it is visible.
|
|
157
159
|
oObjectPage.attachEvent("subSectionEnteredViewPort", this._handleSubSectionEnteredViewPort.bind(this));
|
|
158
160
|
}
|
|
@@ -203,8 +205,8 @@ sap.ui.define(
|
|
|
203
205
|
aTables = this._findTables(),
|
|
204
206
|
oFastCreationRow,
|
|
205
207
|
oObjectPage = this.byId("fe::ObjectPage"),
|
|
206
|
-
oBinding = mParameters.listBinding,
|
|
207
208
|
oInternalModelContext = that.getView().getBindingContext("internal"),
|
|
209
|
+
oInternalModel = that.getView().getModel("internal"),
|
|
208
210
|
aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
|
|
209
211
|
iViewLevel = this.getView().getViewData().viewLevel;
|
|
210
212
|
|
|
@@ -260,29 +262,37 @@ sap.ui.define(
|
|
|
260
262
|
});
|
|
261
263
|
|
|
262
264
|
//Set the Binding for Paginators using ListBinding ID
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
oBinding.
|
|
281
|
-
|
|
282
|
-
|
|
265
|
+
if (iViewLevel > 1) {
|
|
266
|
+
var oBinding = mParameters && mParameters.listBinding,
|
|
267
|
+
oPaginatorCurrentContext = oInternalModel.getProperty("/paginatorCurrentContext");
|
|
268
|
+
if (oPaginatorCurrentContext) {
|
|
269
|
+
var oBindingToUse = oPaginatorCurrentContext.getBinding();
|
|
270
|
+
this.paginator.initialize(oBindingToUse, oPaginatorCurrentContext);
|
|
271
|
+
oInternalModel.setProperty("/paginatorCurrentContext", null);
|
|
272
|
+
} else if (oBinding) {
|
|
273
|
+
if (oBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
274
|
+
this.paginator.initialize(oBinding, oContext);
|
|
275
|
+
} else {
|
|
276
|
+
//if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
|
|
277
|
+
// we need to create it
|
|
278
|
+
var sContextPath = oBinding.getPath().replace(/\([^\)]*\)*$/, ""); //removing the last tuple
|
|
279
|
+
oBinding = new sap.ui.model.odata.v4.ODataListBinding(
|
|
280
|
+
oBinding.oModel,
|
|
281
|
+
"",
|
|
282
|
+
oBinding.oModel.createBindingContext(sContextPath)
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
oBinding.getContexts(0);
|
|
286
|
+
oBinding.attachEvent("change", function _setListBindingAsync() {
|
|
287
|
+
if (oBinding.getContexts().length > 0) {
|
|
288
|
+
that.paginator.initialize(oBinding, oContext);
|
|
289
|
+
oBinding.detachEvent("change", _setListBindingAsync);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
283
293
|
}
|
|
284
294
|
}
|
|
285
|
-
if (oObjectPage.getEnableLazyLoading()) {
|
|
295
|
+
if (!this.getView().getViewData().useNewLazyLoading && oObjectPage.getEnableLazyLoading()) {
|
|
286
296
|
var aSections = oObjectPage.getSections(),
|
|
287
297
|
bUseIconTabBar = oObjectPage.getUseIconTabBar(),
|
|
288
298
|
iSkip = 2,
|
|
@@ -295,7 +305,9 @@ sap.ui.define(
|
|
|
295
305
|
// In IconTabBar mode keep the second section bound if there is an editable header and we are switching to display mode
|
|
296
306
|
if (iSkip < 1 || (bUseIconTabBar && (iSection > 1 || (iSection === 1 && !bEditableHeader && !bIsInEditMode)))) {
|
|
297
307
|
var oSubSection = aSubSections[iSubSection];
|
|
298
|
-
oSubSection.
|
|
308
|
+
if (oSubSection.data().isVisibilityDynamic !== "true") {
|
|
309
|
+
oSubSection.setBindingContext(null);
|
|
310
|
+
}
|
|
299
311
|
}
|
|
300
312
|
}
|
|
301
313
|
}
|
|
@@ -315,37 +327,44 @@ sap.ui.define(
|
|
|
315
327
|
var aActions = oObjectPage.getHeaderTitle() && oObjectPage.getHeaderTitle().getActions();
|
|
316
328
|
if (aActions && aActions.length) {
|
|
317
329
|
oFirstClickableElement = aActions.find(function(oAction) {
|
|
318
|
-
return oAction.getVisible();
|
|
330
|
+
return oAction.getVisible() && oAction.getEnabled();
|
|
319
331
|
});
|
|
320
332
|
}
|
|
321
333
|
return oFirstClickableElement;
|
|
322
334
|
},
|
|
323
335
|
|
|
324
336
|
_getFirstEmptyMandatoryFieldFromSubSection: function(aSubSections) {
|
|
325
|
-
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
var aFormElements = aFormContainers[formContainer].getFormElements();
|
|
343
|
-
|
|
344
|
-
for (var formElement = 0; aFormElements && formElement < aFormElements.length; formElement++) {
|
|
345
|
-
var aFields = aFormElements[formElement].getFields();
|
|
337
|
+
if (aSubSections) {
|
|
338
|
+
for (var subSection = 0; subSection < aSubSections.length; subSection++) {
|
|
339
|
+
var aBlocks = aSubSections[subSection].getBlocks();
|
|
340
|
+
|
|
341
|
+
if (aBlocks) {
|
|
342
|
+
for (var block = 0; block < aBlocks.length; block++) {
|
|
343
|
+
var aFormContainers;
|
|
344
|
+
|
|
345
|
+
if (aBlocks[block].isA("sap.ui.layout.form.Form")) {
|
|
346
|
+
aFormContainers = aBlocks[block].getFormContainers();
|
|
347
|
+
} else if (
|
|
348
|
+
aBlocks[block].getContent &&
|
|
349
|
+
aBlocks[block].getContent() &&
|
|
350
|
+
aBlocks[block].getContent().isA("sap.ui.layout.form.Form")
|
|
351
|
+
) {
|
|
352
|
+
aFormContainers = aBlocks[block].getContent().getFormContainers();
|
|
353
|
+
}
|
|
346
354
|
|
|
347
|
-
if (
|
|
348
|
-
|
|
355
|
+
if (aFormContainers) {
|
|
356
|
+
for (var formContainer = 0; formContainer < aFormContainers.length; formContainer++) {
|
|
357
|
+
var aFormElements = aFormContainers[formContainer].getFormElements();
|
|
358
|
+
if (aFormElements) {
|
|
359
|
+
for (var formElement = 0; formElement < aFormElements.length; formElement++) {
|
|
360
|
+
var aFields = aFormElements[formElement].getFields();
|
|
361
|
+
|
|
362
|
+
if (aFields[0].getRequired() && !aFields[0].getValue()) {
|
|
363
|
+
return aFields[0];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
349
368
|
}
|
|
350
369
|
}
|
|
351
370
|
}
|
|
@@ -354,57 +373,58 @@ sap.ui.define(
|
|
|
354
373
|
return undefined;
|
|
355
374
|
},
|
|
356
375
|
|
|
357
|
-
|
|
358
|
-
|
|
376
|
+
_updateFocusInEditMode: function(aSubSections) {
|
|
377
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
378
|
+
|
|
379
|
+
var oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
|
|
380
|
+
var oFieldToFocus;
|
|
381
|
+
if (oMandatoryField) {
|
|
382
|
+
oFieldToFocus = oMandatoryField.content.getContentEdit()[0];
|
|
383
|
+
} else {
|
|
384
|
+
oFieldToFocus = oObjectPage._getFirstEditableInput() || this._getFirstClickableElement(oObjectPage);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (oFieldToFocus) {
|
|
388
|
+
setTimeout(function() {
|
|
389
|
+
// We set the focus in a timeeout, otherwise the focus sometimes goes to the TabBar
|
|
390
|
+
oFieldToFocus.focus();
|
|
391
|
+
}, 0);
|
|
392
|
+
}
|
|
359
393
|
},
|
|
360
394
|
|
|
361
395
|
_handleSubSectionEnteredViewPort: function(oEvent) {
|
|
362
396
|
var oSubSection = oEvent.getParameter("subSection");
|
|
363
|
-
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
364
397
|
oSubSection.setBindingContext(undefined);
|
|
365
|
-
var oObjectPage = this.byId("fe::ObjectPage");
|
|
366
|
-
if (oObjectPage.getModel("ui").getProperty("/editMode") !== "Display") {
|
|
367
|
-
if (
|
|
368
|
-
this.getView().getViewData().sectionLayout === "Tabs" &&
|
|
369
|
-
this.initialTab.value === false &&
|
|
370
|
-
oInternalModelContext.getProperty("errorNavigationSectionFlag") === false
|
|
371
|
-
) {
|
|
372
|
-
var oFieldToFocus = this._getFirstEmptyMandatoryFieldFromSubSection([oSubSection]);
|
|
373
|
-
if (oFieldToFocus) {
|
|
374
|
-
oFieldToFocus.content.getContentEdit()[0].focus();
|
|
375
|
-
} else {
|
|
376
|
-
var oFirstEditableInput = oObjectPage._getFirstEditableInput();
|
|
377
|
-
if (oFirstEditableInput) {
|
|
378
|
-
oFirstEditableInput.focus();
|
|
379
|
-
} else {
|
|
380
|
-
var oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
|
|
381
|
-
if (oFirstClickableElement) {
|
|
382
|
-
oFirstClickableElement.focus();
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
398
|
},
|
|
389
399
|
|
|
390
400
|
_onBackNavigationInDraft: function(oContext) {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
401
|
+
if (
|
|
402
|
+
this.getAppComponent()
|
|
403
|
+
.getRouterProxy()
|
|
404
|
+
.checkIfBackHasSameContext()
|
|
405
|
+
) {
|
|
406
|
+
// Back nav will keep the same context --> no need to display the dialog
|
|
407
|
+
history.back();
|
|
408
|
+
} else {
|
|
409
|
+
CommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(
|
|
410
|
+
function() {
|
|
411
|
+
history.back();
|
|
412
|
+
},
|
|
413
|
+
Function.prototype,
|
|
414
|
+
oContext,
|
|
415
|
+
this,
|
|
416
|
+
false
|
|
417
|
+
);
|
|
418
|
+
}
|
|
400
419
|
},
|
|
401
420
|
|
|
402
421
|
_onAfterBinding: function(oBindingContext, mParameters) {
|
|
403
422
|
var oObjectPage = this.byId("fe::ObjectPage"),
|
|
404
423
|
that = this,
|
|
405
|
-
aTables = this._findTables()
|
|
424
|
+
aTables = this._findTables(),
|
|
425
|
+
aFormContainers = this._findFormContainers();
|
|
406
426
|
|
|
407
|
-
this.
|
|
427
|
+
this._sideEffects.clearPropertiesStatus();
|
|
408
428
|
|
|
409
429
|
// TODO: this is only a temp solution as long as the model fix the cache issue and we use this additional
|
|
410
430
|
// binding with ownRequest
|
|
@@ -416,6 +436,32 @@ sap.ui.define(
|
|
|
416
436
|
aIBNActions = CommonUtils.getIBNActions(oSubSection, aIBNActions);
|
|
417
437
|
});
|
|
418
438
|
});
|
|
439
|
+
|
|
440
|
+
// Assign internal binding contexts to oFormContainer:
|
|
441
|
+
// 1. It is not possible to assign the internal binding context to the XML fragment
|
|
442
|
+
// (FormContainer.fragment.xml) yet - it is used already for the data-structure.
|
|
443
|
+
// 2. Another problem is, that FormContainers assigned to a 'MoreBlock' does not have an
|
|
444
|
+
// internal model context at all.
|
|
445
|
+
|
|
446
|
+
aFormContainers.forEach(function(oFormContainer) {
|
|
447
|
+
var oInternalModelContext,
|
|
448
|
+
oInternalModel = oObjectPage.getModel("internal"),
|
|
449
|
+
sPageContextPath = "/pages/" + that.getView().getId(),
|
|
450
|
+
sFormContainerContextPath = "controls/" + that.getView().getLocalId(oFormContainer.getId()),
|
|
451
|
+
SHOW_DETAILS = "showDetails";
|
|
452
|
+
if (oFormContainer.getModel("internal") === undefined) {
|
|
453
|
+
oFormContainer.setModel(oInternalModel, "internal");
|
|
454
|
+
oFormContainer.setBindingContext(
|
|
455
|
+
oInternalModel.createBindingContext(sPageContextPath + "/" + sFormContainerContextPath),
|
|
456
|
+
"internal"
|
|
457
|
+
);
|
|
458
|
+
oFormContainer.bindElement({ path: "", model: "internal" });
|
|
459
|
+
} else {
|
|
460
|
+
oFormContainer.bindElement({ path: sFormContainerContextPath, model: "internal" });
|
|
461
|
+
}
|
|
462
|
+
oInternalModelContext = oFormContainer.getBindingContext("internal");
|
|
463
|
+
oInternalModelContext.setProperty(SHOW_DETAILS, false);
|
|
464
|
+
});
|
|
419
465
|
aTables.forEach(function(oTable) {
|
|
420
466
|
var oInternalModelContext = oTable.getBindingContext("internal");
|
|
421
467
|
oInternalModelContext.setProperty("creationRowFieldValidity", {});
|
|
@@ -434,7 +480,6 @@ sap.ui.define(
|
|
|
434
480
|
}
|
|
435
481
|
}
|
|
436
482
|
// Workaround ends here!!
|
|
437
|
-
TableUtils.getSemanticTargetsFromTable(that, oTable);
|
|
438
483
|
|
|
439
484
|
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
440
485
|
// The same is also performed on Table selectionChange event
|
|
@@ -557,98 +602,69 @@ sap.ui.define(
|
|
|
557
602
|
});
|
|
558
603
|
});
|
|
559
604
|
|
|
560
|
-
|
|
561
|
-
|
|
605
|
+
if (!this.getView().getViewData().useNewLazyLoading) {
|
|
606
|
+
// should be called only after binding is ready hence calling it in onAfterBinding
|
|
607
|
+
oObjectPage._triggerVisibleSubSectionsEvents();
|
|
608
|
+
}
|
|
562
609
|
}
|
|
563
610
|
},
|
|
564
611
|
onPageReady: function(mParameters) {
|
|
565
612
|
// Apply app state only after the page is ready with the first section selected
|
|
566
|
-
function getVisibleSections(oObjectPage) {
|
|
567
|
-
var aVisibleSections;
|
|
568
|
-
var aSections = oObjectPage.getSections();
|
|
569
|
-
if (aSections && aSections.length) {
|
|
570
|
-
aVisibleSections = aSections.filter(function(oSection) {
|
|
571
|
-
return oSection.getVisible() === true;
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
return aVisibleSections;
|
|
575
|
-
}
|
|
576
613
|
var that = this;
|
|
577
|
-
var
|
|
578
|
-
var
|
|
614
|
+
var oView = this.getView();
|
|
615
|
+
var oInternalModelContext = oView.getBindingContext("internal");
|
|
616
|
+
var oBindingContext = oView.getBindingContext();
|
|
579
617
|
//Show popup while navigating back from object page in case of draft
|
|
580
618
|
if (oBindingContext) {
|
|
581
619
|
var bIsStickyMode = ModelHelper.isStickySessionSupported(oBindingContext.getModel().getMetaModel());
|
|
582
620
|
if (!bIsStickyMode) {
|
|
583
|
-
var oAppComponent = CommonUtils.getAppComponent(
|
|
621
|
+
var oAppComponent = CommonUtils.getAppComponent(oView);
|
|
584
622
|
oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInDraft.bind(that, oBindingContext));
|
|
585
623
|
}
|
|
586
624
|
}
|
|
587
625
|
this.getAppComponent()
|
|
588
626
|
.getAppStateHandler()
|
|
589
627
|
.applyAppState();
|
|
590
|
-
var oLastFocusedControl = mParameters.lastFocusedControl;
|
|
591
|
-
if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
|
|
592
|
-
var oView = this.getView();
|
|
593
|
-
var oFocusControl = oView.byId(oLastFocusedControl.controlId);
|
|
594
|
-
if (oFocusControl) {
|
|
595
|
-
oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
var oObjectPage = this.byId("fe::ObjectPage");
|
|
600
|
-
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
601
|
-
var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
|
|
602
|
-
var oFirstClickableElement;
|
|
603
|
-
var aVisibleSections = getVisibleSections(oObjectPage);
|
|
604
628
|
|
|
605
|
-
if (
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
//Focus on first mandatory empty field
|
|
629
|
+
if (mParameters.forceFocus) {
|
|
630
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
631
|
+
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
632
|
+
var isInDisplayMode = oObjectPage.getModel("ui").getProperty("/editMode") === "Display";
|
|
633
|
+
var aVisibleSections = oObjectPage.getSections().filter(function(oSection) {
|
|
634
|
+
return oSection.getVisible() === true;
|
|
635
|
+
});
|
|
636
|
+
// Select the first visible section
|
|
614
637
|
oObjectPage.setSelectedSection(aVisibleSections[0].getId());
|
|
615
|
-
if (
|
|
616
|
-
this.getView().getViewData().sectionLayout === "Page" ||
|
|
617
|
-
(this.getView().getViewData().sectionLayout === "Tabs" && this.initialTab.value === true)
|
|
618
|
-
) {
|
|
619
|
-
var oFieldToFocus;
|
|
620
|
-
var aSubSections = [];
|
|
621
|
-
for (var section = 0; section < aVisibleSections.length; section++) {
|
|
622
|
-
aSubSections = aVisibleSections[section].getSubSections();
|
|
623
|
-
oFieldToFocus = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
|
|
624
|
-
if (oFieldToFocus) {
|
|
625
|
-
oFieldToFocus.content.getContentEdit()[0].focus();
|
|
626
|
-
break;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
638
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
639
|
+
if (isInDisplayMode) {
|
|
640
|
+
var oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
|
|
641
|
+
if (oFirstClickableElement) {
|
|
642
|
+
oFirstClickableElement.focus();
|
|
643
|
+
}
|
|
644
|
+
} else {
|
|
645
|
+
var aVisibleSubSections;
|
|
646
|
+
if (oView.getViewData().sectionLayout === "Tabs") {
|
|
647
|
+
// In a tabbed layout, only the subsections of the selected section are visible on the screen
|
|
648
|
+
aVisibleSubSections = aVisibleSections[0].getSubSections();
|
|
636
649
|
} else {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
650
|
+
// In a paged layout, all subsections of the visible sections are visible on the screen
|
|
651
|
+
aVisibleSubSections = aVisibleSections
|
|
652
|
+
.map(function(oSection) {
|
|
653
|
+
return oSection.getSubSections();
|
|
654
|
+
})
|
|
655
|
+
.flat();
|
|
641
656
|
}
|
|
657
|
+
this._updateFocusInEditMode(aVisibleSubSections);
|
|
642
658
|
}
|
|
643
|
-
this.initialTab.value = false;
|
|
644
659
|
}
|
|
660
|
+
|
|
645
661
|
oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
|
|
646
662
|
this._checkDataPointTitleForExternalNavigation();
|
|
647
663
|
},
|
|
648
664
|
/**
|
|
649
|
-
* Get
|
|
665
|
+
* Get the status of edit mode for sticky session.
|
|
650
666
|
*
|
|
651
|
-
* @returns {boolean}
|
|
667
|
+
* @returns {boolean} The status of edit mode for sticky session
|
|
652
668
|
*
|
|
653
669
|
*
|
|
654
670
|
*/
|
|
@@ -680,7 +696,7 @@ sap.ui.define(
|
|
|
680
696
|
icon: ""
|
|
681
697
|
};
|
|
682
698
|
|
|
683
|
-
return
|
|
699
|
+
return oTitleInfo;
|
|
684
700
|
},
|
|
685
701
|
|
|
686
702
|
_executeHeaderShortcut: function(sId) {
|
|
@@ -815,7 +831,9 @@ sap.ui.define(
|
|
|
815
831
|
.saveDocument(oContext, mParameters)
|
|
816
832
|
.catch(that._showMessagePopover.bind(that))
|
|
817
833
|
.finally(function() {
|
|
818
|
-
BusyLocker.
|
|
834
|
+
if (BusyLocker.isLocked(oModel)) {
|
|
835
|
+
BusyLocker.unlock(oModel);
|
|
836
|
+
}
|
|
819
837
|
});
|
|
820
838
|
});
|
|
821
839
|
},
|
|
@@ -898,6 +916,37 @@ sap.ui.define(
|
|
|
898
916
|
return aBlocks;
|
|
899
917
|
},
|
|
900
918
|
|
|
919
|
+
_findFormContainers: function() {
|
|
920
|
+
var aSubSections = this._getAllSubSections(),
|
|
921
|
+
aFormContainers = [];
|
|
922
|
+
|
|
923
|
+
function _collectFormContainersInBlocks(aBlocks) {
|
|
924
|
+
for (var i = 0; i < aBlocks.length; i++) {
|
|
925
|
+
var oElement = aBlocks[i].getContent instanceof Function && aBlocks[i].getContent();
|
|
926
|
+
if (oElement && oElement.isA && oElement.isA("sap.ui.layout.DynamicSideContent")) {
|
|
927
|
+
oElement = oElement.getMainContent instanceof Function && oElement.getMainContent();
|
|
928
|
+
if (oElement && oElement.length > 0) {
|
|
929
|
+
oElement = oElement[0];
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
if (
|
|
933
|
+
oElement &&
|
|
934
|
+
oElement.isA &&
|
|
935
|
+
oElement.isA("sap.ui.layout.form.Form") &&
|
|
936
|
+
oElement.getFormContainers instanceof Function
|
|
937
|
+
) {
|
|
938
|
+
aFormContainers = aFormContainers.concat(oElement.getFormContainers());
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
for (var i = 0; i < aSubSections.length; i++) {
|
|
944
|
+
_collectFormContainersInBlocks(aSubSections[i].getBlocks());
|
|
945
|
+
_collectFormContainersInBlocks(aSubSections[i].getMoreBlocks());
|
|
946
|
+
}
|
|
947
|
+
return aFormContainers;
|
|
948
|
+
},
|
|
949
|
+
|
|
901
950
|
//TODO: This is needed for two workarounds - to be removed again
|
|
902
951
|
_findTables: function() {
|
|
903
952
|
var aSubSections = this._getAllSubSections(),
|
|
@@ -1069,20 +1118,17 @@ sap.ui.define(
|
|
|
1069
1118
|
aPathParts.forEach(function(sPathPart, i) {
|
|
1070
1119
|
sPath += "/" + sPathPart;
|
|
1071
1120
|
var oRootViewController = oAppComponent.getRootViewController();
|
|
1072
|
-
var oTitleHierarchyCache = oRootViewController.getTitleHierarchyCache();
|
|
1073
1121
|
var pWaitForTitleHiearchyInfo;
|
|
1074
1122
|
var sParameterPath = oMetaModel.getMetaPath(sPath);
|
|
1075
|
-
var bResultContext = oMetaModel.
|
|
1123
|
+
var bResultContext = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
|
|
1076
1124
|
if (bResultContext) {
|
|
1077
1125
|
// We dont need to create a breadcrumb for Parameter path
|
|
1078
1126
|
iSkipParameterized = 1;
|
|
1079
1127
|
return;
|
|
1080
1128
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
pWaitForTitleHiearchyInfo = Promise.resolve(oTitleHierarchyCache[sPath]);
|
|
1085
|
-
}
|
|
1129
|
+
|
|
1130
|
+
pWaitForTitleHiearchyInfo = oRootViewController.getTitleInfoFromPath(sPath);
|
|
1131
|
+
|
|
1086
1132
|
pWaitForTitleHiearchyInfo
|
|
1087
1133
|
.then(function(oTitleHiearchyInfo) {
|
|
1088
1134
|
var idx = i - iSkipParameterized,
|
|
@@ -1300,7 +1346,8 @@ sap.ui.define(
|
|
|
1300
1346
|
.getModel()
|
|
1301
1347
|
.getMetaModel()
|
|
1302
1348
|
.getMetaPath(oDataPointOrChartBindingContext.getPath()),
|
|
1303
|
-
aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath)
|
|
1349
|
+
aNavigationData = oController._getChartContextData(oDataPointOrChartBindingContext, sCollectionPath),
|
|
1350
|
+
additionalNavigationParameters;
|
|
1304
1351
|
|
|
1305
1352
|
aNavigationData = aNavigationData.map(function(oNavigationData) {
|
|
1306
1353
|
return {
|
|
@@ -1308,10 +1355,18 @@ sap.ui.define(
|
|
|
1308
1355
|
metaPath: sMetaPath + (sCollectionPath ? "/" + sCollectionPath : "")
|
|
1309
1356
|
};
|
|
1310
1357
|
});
|
|
1358
|
+
if (oTargetInfo && oTargetInfo.parameters) {
|
|
1359
|
+
var oParams =
|
|
1360
|
+
oTargetInfo.parameters && oController._intentBasedNavigation.getOutboundParams(oTargetInfo.parameters);
|
|
1361
|
+
if (Object.keys(oParams).length > 0) {
|
|
1362
|
+
additionalNavigationParameters = oParams;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1311
1365
|
if (oTargetInfo && oTargetInfo.semanticObject && oTargetInfo.action) {
|
|
1312
1366
|
oController._intentBasedNavigation.navigate(oTargetInfo.semanticObject, oTargetInfo.action, {
|
|
1313
1367
|
navigationContexts: aNavigationData,
|
|
1314
|
-
semanticObjectMapping: aSemanticObjectMapping
|
|
1368
|
+
semanticObjectMapping: aSemanticObjectMapping,
|
|
1369
|
+
additionalNavigationParameters: additionalNavigationParameters
|
|
1315
1370
|
});
|
|
1316
1371
|
}
|
|
1317
1372
|
},
|
|
@@ -1339,6 +1394,17 @@ sap.ui.define(
|
|
|
1339
1394
|
//will be called always when we click on a section tab
|
|
1340
1395
|
this.getExtensionAPI().updateAppState();
|
|
1341
1396
|
this.bSectionNavigated = true;
|
|
1397
|
+
|
|
1398
|
+
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
1399
|
+
var oObjectPage = this.byId("fe::ObjectPage");
|
|
1400
|
+
if (
|
|
1401
|
+
oObjectPage.getModel("ui").getProperty("/editMode") !== "Display" &&
|
|
1402
|
+
this.getView().getViewData().sectionLayout === "Tabs" &&
|
|
1403
|
+
oInternalModelContext.getProperty("errorNavigationSectionFlag") === false
|
|
1404
|
+
) {
|
|
1405
|
+
var oSubSection = oEvent.getParameter("subSection");
|
|
1406
|
+
this._updateFocusInEditMode([oSubSection]);
|
|
1407
|
+
}
|
|
1342
1408
|
},
|
|
1343
1409
|
onVariantSelected: function(oEvent) {
|
|
1344
1410
|
this.getExtensionAPI().updateAppState();
|
|
@@ -1394,11 +1460,6 @@ sap.ui.define(
|
|
|
1394
1460
|
onChartSelectionChanged: function(oEvent) {
|
|
1395
1461
|
ChartRuntime.fnUpdateChart(oEvent);
|
|
1396
1462
|
}
|
|
1397
|
-
},
|
|
1398
|
-
formatters: {
|
|
1399
|
-
compareTitleFromTableAndTab: function(headerVisible, tableTitle, tabTitle) {
|
|
1400
|
-
return this.commonFormatters.compareTitleFromTableAndTab(headerVisible, tableTitle, tabTitle, this);
|
|
1401
|
-
}
|
|
1402
1463
|
}
|
|
1403
1464
|
});
|
|
1404
1465
|
}
|
|
@@ -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
|
sap.ui.define(
|
|
6
6
|
["sap/m/HBox", "sap/m/HBoxRenderer", "sap/ui/core/StashedControlSupport"],
|
|
@@ -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
|
}
|