@sapui5/sap.fe.core 1.96.2 → 1.96.5
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/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +1 -1
- package/src/sap/fe/core/AppComponent.js +1 -1
- package/src/sap/fe/core/AppStateHandler.js +18 -4
- package/src/sap/fe/core/BaseController.js +1 -1
- package/src/sap/fe/core/BusyLocker.js +1 -1
- package/src/sap/fe/core/CommonUtils.js +1 -1
- package/src/sap/fe/core/ExtensionAPI.js +1 -1
- package/src/sap/fe/core/PageController.js +1 -1
- package/src/sap/fe/core/RouterProxy.js +59 -69
- package/src/sap/fe/core/Synchronization.js +1 -1
- package/src/sap/fe/core/TemplateComponent.js +3 -3
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TransactionHelper.js +1 -1
- package/src/sap/fe/core/actions/draft.js +1 -1
- package/src/sap/fe/core/actions/messageHandling.js +1 -1
- package/src/sap/fe/core/actions/nonDraft.js +1 -1
- package/src/sap/fe/core/actions/operations.js +1 -1
- package/src/sap/fe/core/actions/sticky.js +1 -1
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js +23 -17
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +19 -49
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +32 -20
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +33 -20
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +1 -1
- package/src/sap/fe/core/controllerextensions/Paginator.js +1 -1
- package/src/sap/fe/core/controllerextensions/Placeholder.js +1 -1
- package/src/sap/fe/core/controllerextensions/Routing.js +1 -1
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +2 -4
- package/src/sap/fe/core/controllerextensions/ViewState.js +1 -1
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/ConditionalWrapper.js +1 -1
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +1 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
- package/src/sap/fe/core/controls/FieldWrapper.js +1 -1
- package/src/sap/fe/core/controls/FilterBar.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +1 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -8
- package/src/sap/fe/core/converters/controls/Common/Form.ts +9 -3
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +14 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +26 -5
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +1 -1
- package/src/sap/fe/core/fpm/Component.js +1 -1
- package/src/sap/fe/core/helpers/BindingExpression.js +34 -2
- package/src/sap/fe/core/helpers/BindingExpression.ts +24 -1
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -1
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.js +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
- package/src/sap/fe/core/library.js +2 -2
- package/src/sap/fe/core/library.support.js +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +21 -10
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +2 -2
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +7 -3
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.js +5 -25
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +5 -24
- package/src/sap/fe/core/templating/UIFormatters.js +4 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +1 -0
package/package.json
CHANGED
package/src/sap/fe/core/.library
CHANGED
|
@@ -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
|
[
|
|
@@ -13,9 +13,22 @@ sap.ui.define(
|
|
|
13
13
|
"sap/base/Log",
|
|
14
14
|
"sap/base/util/merge",
|
|
15
15
|
"sap/base/util/deepEqual",
|
|
16
|
-
"sap/fe/core/BusyLocker"
|
|
16
|
+
"sap/fe/core/BusyLocker",
|
|
17
|
+
"sap/fe/core/helpers/ModelHelper"
|
|
17
18
|
],
|
|
18
|
-
function(
|
|
19
|
+
function(
|
|
20
|
+
StateUtil,
|
|
21
|
+
BaseObject,
|
|
22
|
+
CoreLibrary,
|
|
23
|
+
NavLibrary,
|
|
24
|
+
CommonUtils,
|
|
25
|
+
ControlVariantApplyAPI,
|
|
26
|
+
Log,
|
|
27
|
+
merge,
|
|
28
|
+
deepEqual,
|
|
29
|
+
BusyLocker,
|
|
30
|
+
ModelHelper
|
|
31
|
+
) {
|
|
19
32
|
"use strict";
|
|
20
33
|
|
|
21
34
|
var NavType = NavLibrary.NavType;
|
|
@@ -59,6 +72,7 @@ sap.ui.define(
|
|
|
59
72
|
oRouterProxy = this.oAppComponent.getRouterProxy(),
|
|
60
73
|
sHash = oRouterProxy.getHash(),
|
|
61
74
|
oController = this.oAppComponent.getRootControl().getController(),
|
|
75
|
+
bIsStickyMode = ModelHelper.isStickySessionSupported(this.oAppComponent.getMetaModel()),
|
|
62
76
|
that = this;
|
|
63
77
|
|
|
64
78
|
if (!oController.viewState) {
|
|
@@ -76,7 +90,7 @@ sap.ui.define(
|
|
|
76
90
|
var sAppStateKey = oAppState.appStateKey;
|
|
77
91
|
var sNewHash = oNavigationService.replaceInnerAppStateKey(sHash, sAppStateKey);
|
|
78
92
|
if (sNewHash !== sHash) {
|
|
79
|
-
oRouterProxy.navToHash(sNewHash);
|
|
93
|
+
oRouterProxy.navToHash(sNewHash, null, null, null, !bIsStickyMode);
|
|
80
94
|
that.bNoRouteChange = true;
|
|
81
95
|
}
|
|
82
96
|
Log.info("APPSTATE: navToHash");
|
|
@@ -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/ui/base/Object", "sap/fe/core/CommonUtils", "sap/base/Log", "sap/ui/core/Component", "sap/ui/model/json/JSONModel"],
|
|
@@ -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
|
/* eslint-disable no-alert */
|
|
6
6
|
sap.ui.define(
|
|
@@ -128,6 +128,7 @@ sap.ui.define(
|
|
|
128
128
|
this._bDisableOnHashChange = false;
|
|
129
129
|
this._bIgnoreRestore = false;
|
|
130
130
|
this._bCleanedRestore = false;
|
|
131
|
+
this._bForceFocus = true; // Trigger the focus mechanism for the first view displayed by the app
|
|
131
132
|
},
|
|
132
133
|
|
|
133
134
|
destroy: function() {
|
|
@@ -158,6 +159,14 @@ sap.ui.define(
|
|
|
158
159
|
return this._oRouter.getHashChanger().getHash();
|
|
159
160
|
},
|
|
160
161
|
|
|
162
|
+
isFocusForced: function() {
|
|
163
|
+
return this._bForceFocus;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
setFocusForced: function(bForced) {
|
|
167
|
+
this._bForceFocus = bForced;
|
|
168
|
+
},
|
|
169
|
+
|
|
161
170
|
/**
|
|
162
171
|
* Resets the internal variable sIAppStateKey.
|
|
163
172
|
*
|
|
@@ -180,42 +189,34 @@ sap.ui.define(
|
|
|
180
189
|
* @param {string} sHash Hash to be navigated to
|
|
181
190
|
* @param {boolean} bPreserveHistory If set to true, non-ancestor entries in history will be retained
|
|
182
191
|
* @param {boolean} bDisablePreservationCache If set to true, cache preservation mechanism is disabled for the current navigation
|
|
183
|
-
* @
|
|
192
|
+
* @param {boolean} bForceFocus If set to true, the logic to set the focus once the navigation is finalized will be triggered (onPageReady)
|
|
193
|
+
* @param {boolean} bPreserveShellBackNavigationHandler If not set to false, the back navigation is set to undefined
|
|
194
|
+
* @returns {Promise} Promise (resolved when the navigation is finalized) that returns 'true' if a navigation took place, 'false' if the navigation didn't happen
|
|
184
195
|
* @ui5-restricted
|
|
185
196
|
*/
|
|
186
|
-
navToHash: function(sHash, bPreserveHistory, bDisablePreservationCache) {
|
|
197
|
+
navToHash: function(sHash, bPreserveHistory, bDisablePreservationCache, bForceFocus, bPreserveShellBackNavigationHandler) {
|
|
187
198
|
var that = this;
|
|
188
|
-
|
|
199
|
+
if (bPreserveShellBackNavigationHandler !== false) {
|
|
200
|
+
this._oShellServices.setBackNavigation();
|
|
201
|
+
}
|
|
189
202
|
if (this._oRouteMatchSynchronization) {
|
|
190
203
|
return this._oRouteMatchSynchronization.waitFor().then(function() {
|
|
191
204
|
that._oRouteMatchSynchronization = null;
|
|
192
|
-
return that._internalNavToHash(sHash, bPreserveHistory, bDisablePreservationCache);
|
|
205
|
+
return that._internalNavToHash(sHash, bPreserveHistory, bDisablePreservationCache, bForceFocus);
|
|
193
206
|
});
|
|
194
207
|
} else {
|
|
195
208
|
if (this._bActivateRouteMatchSynchro) {
|
|
196
209
|
this.waitForRouteMatchBeforeNavigation();
|
|
197
210
|
}
|
|
198
|
-
return that._internalNavToHash(sHash, bPreserveHistory, bDisablePreservationCache);
|
|
211
|
+
return that._internalNavToHash(sHash, bPreserveHistory, bDisablePreservationCache, bForceFocus);
|
|
199
212
|
}
|
|
200
213
|
},
|
|
201
214
|
|
|
202
|
-
_internalNavToHash: function(sHash, bPreserveHistory, bDisablePreservationCache) {
|
|
203
|
-
var that = this,
|
|
204
|
-
sLastFocusControlId = sap.ui.getCore().getCurrentFocusedControlId(),
|
|
205
|
-
sLastFocusInfo =
|
|
206
|
-
sLastFocusControlId && sap.ui.getCore().byId(sLastFocusControlId)
|
|
207
|
-
? sap.ui
|
|
208
|
-
.getCore()
|
|
209
|
-
.byId(sLastFocusControlId)
|
|
210
|
-
.getFocusInfo()
|
|
211
|
-
: null,
|
|
212
|
-
shashBeforeRoutechanged = this.getHash();
|
|
213
|
-
|
|
215
|
+
_internalNavToHash: function(sHash, bPreserveHistory, bDisablePreservationCache, bForceFocus) {
|
|
214
216
|
// Add the app state in the hash if needed
|
|
215
217
|
if (this.fclEnabled && this.sIAppStateKey && !findAppStateInHash(sHash)) {
|
|
216
218
|
sHash = setAppStateInHash(sHash, this.sIAppStateKey);
|
|
217
219
|
}
|
|
218
|
-
var oNewState = this._extractStateFromHash(sHash);
|
|
219
220
|
|
|
220
221
|
if (!this.checkHashWithGuard(sHash)) {
|
|
221
222
|
if (!this.oResourceBundle) {
|
|
@@ -230,11 +231,24 @@ sap.ui.define(
|
|
|
230
231
|
}
|
|
231
232
|
this.bIsGuardCrossAllowed = true;
|
|
232
233
|
}
|
|
234
|
+
|
|
235
|
+
// In case the navigation will cause a new view to be displayed, we force the focus
|
|
236
|
+
// I.e. if the keys for the hash we're navigating to is a superset of the current hash keys.
|
|
237
|
+
var oNewState = this._extractStateFromHash(sHash);
|
|
238
|
+
if (!this._bForceFocus) {
|
|
239
|
+
// If the focus was already forced, keep it
|
|
240
|
+
var aCurrentHashKeys = this._extractKeysFromHash(this.getHash());
|
|
241
|
+
this._bForceFocus =
|
|
242
|
+
bForceFocus ||
|
|
243
|
+
(aCurrentHashKeys.length < oNewState.keys.length &&
|
|
244
|
+
aCurrentHashKeys.every(function(key, index) {
|
|
245
|
+
return key === oNewState.keys[index];
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
|
|
233
249
|
var oHistoryAction = this._pushNewState(oNewState, false, bPreserveHistory, bDisablePreservationCache);
|
|
234
250
|
|
|
235
|
-
return this._rebuildBrowserHistory(oHistoryAction, false)
|
|
236
|
-
that.storeFocusForHash(sLastFocusControlId, sLastFocusInfo, shashBeforeRoutechanged);
|
|
237
|
-
});
|
|
251
|
+
return this._rebuildBrowserHistory(oHistoryAction, false);
|
|
238
252
|
},
|
|
239
253
|
|
|
240
254
|
/**
|
|
@@ -258,34 +272,6 @@ sap.ui.define(
|
|
|
258
272
|
}
|
|
259
273
|
},
|
|
260
274
|
|
|
261
|
-
getFocusControlForCurrentHash: function() {
|
|
262
|
-
var sCurrenthash = this.getHash();
|
|
263
|
-
var oLastFocusedControl;
|
|
264
|
-
for (var i = this._oManagedHistory.length - 1; i >= 0; i--) {
|
|
265
|
-
if (sCurrenthash === this._oManagedHistory[i].hash) {
|
|
266
|
-
oLastFocusedControl = this._oManagedHistory[i].oLastFocusControl;
|
|
267
|
-
break;
|
|
268
|
-
} else {
|
|
269
|
-
this._oManagedHistory[i].oLastFocusControl = undefined;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return oLastFocusedControl;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
storeFocusForHash: function(sLastFocusControlId, sLastFocusInfo, sHash) {
|
|
277
|
-
var oManagedhistory = this._oManagedHistory;
|
|
278
|
-
for (var i = 0; i < oManagedhistory.length; i++) {
|
|
279
|
-
if (sHash === oManagedhistory[i].hash) {
|
|
280
|
-
oManagedhistory[i].oLastFocusControl = {
|
|
281
|
-
controlId: sLastFocusControlId,
|
|
282
|
-
focusInfo: sLastFocusInfo
|
|
283
|
-
};
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
|
|
289
275
|
/**
|
|
290
276
|
* Navigates back in the history.
|
|
291
277
|
*
|
|
@@ -316,7 +302,6 @@ sap.ui.define(
|
|
|
316
302
|
|
|
317
303
|
/**
|
|
318
304
|
* Navigates to a route with parameters.
|
|
319
|
-
*
|
|
320
305
|
* @param {string} sRouteName The route name to be navigated to
|
|
321
306
|
* @param {object} oParameters Parameters for the navigation
|
|
322
307
|
* @returns {Promise} Promise that is resolved when the navigation is finalized
|
|
@@ -324,7 +309,7 @@ sap.ui.define(
|
|
|
324
309
|
*/
|
|
325
310
|
navTo: function(sRouteName, oParameters) {
|
|
326
311
|
var sHash = this._oRouter.getURL(sRouteName, oParameters);
|
|
327
|
-
return this.navToHash(sHash, false, oParameters.noPreservationCache);
|
|
312
|
+
return this.navToHash(sHash, false, oParameters.noPreservationCache, null, !oParameters.bIsStickyMode);
|
|
328
313
|
},
|
|
329
314
|
|
|
330
315
|
/**
|
|
@@ -432,6 +417,24 @@ sap.ui.define(
|
|
|
432
417
|
this._bActivateRouteMatchSynchro = false;
|
|
433
418
|
},
|
|
434
419
|
|
|
420
|
+
_extractKeysFromHash: function(sHash) {
|
|
421
|
+
if (sHash === undefined) {
|
|
422
|
+
sHash = "";
|
|
423
|
+
}
|
|
424
|
+
var sHashNoParams = sHash.split("?")[0]; // remove params
|
|
425
|
+
var aTokens = sHashNoParams.split("/");
|
|
426
|
+
var aKeys = [];
|
|
427
|
+
|
|
428
|
+
aTokens.forEach(function(sToken) {
|
|
429
|
+
var regexKey = /[^\(\)]+\([^\(\)]+\)/; // abc(def)
|
|
430
|
+
if (regexKey.test(sToken)) {
|
|
431
|
+
aKeys.push(sToken.split("(")[0]);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
return aKeys;
|
|
436
|
+
},
|
|
437
|
+
|
|
435
438
|
/**
|
|
436
439
|
* Builds a state from a hash.
|
|
437
440
|
*
|
|
@@ -441,22 +444,13 @@ sap.ui.define(
|
|
|
441
444
|
* @ui5-restricted
|
|
442
445
|
*/
|
|
443
446
|
_extractStateFromHash: function(sHash) {
|
|
444
|
-
var oState = {
|
|
445
|
-
keys: []
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
// Retrieve object keys
|
|
449
447
|
if (sHash === undefined) {
|
|
450
448
|
sHash = "";
|
|
451
449
|
}
|
|
452
|
-
|
|
453
|
-
var
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (regexKey.test(sToken)) {
|
|
457
|
-
oState.keys.push(sToken.split("(")[0]);
|
|
458
|
-
}
|
|
459
|
-
});
|
|
450
|
+
|
|
451
|
+
var oState = {
|
|
452
|
+
keys: this._extractKeysFromHash(sHash)
|
|
453
|
+
};
|
|
460
454
|
|
|
461
455
|
// Retrieve layout (if any)
|
|
462
456
|
var aLayout = sHash.match(new RegExp("\\?.*" + enumURLParams.LAYOUTPARAM + "=([^&]*)"));
|
|
@@ -518,7 +512,6 @@ sap.ui.define(
|
|
|
518
512
|
}
|
|
519
513
|
|
|
520
514
|
// 3. Then pop all states until we find an ancestor of the new state, or we find a state that need to be preserved
|
|
521
|
-
var oLastFocusControl;
|
|
522
515
|
var oLastRemovedItem;
|
|
523
516
|
while (this._oManagedHistory.length > 0) {
|
|
524
517
|
var oTopState = this._oManagedHistory[this._oManagedHistory.length - 1];
|
|
@@ -527,13 +520,11 @@ sap.ui.define(
|
|
|
527
520
|
this._compareCacheStates(oTopState, oNewState) !== enumState.ANCESTOR
|
|
528
521
|
) {
|
|
529
522
|
// The top state is not an ancestor of oNewState and is not preserved --> we can pop it
|
|
530
|
-
oLastFocusControl = oTopState.oLastFocusControl;
|
|
531
523
|
oLastRemovedItem = this._oManagedHistory.pop();
|
|
532
524
|
iPopCount++;
|
|
533
525
|
} else if (oTopState.preserved && removeAppStateInHash(oTopState.hash) === removeAppStateInHash(oNewState.hash)) {
|
|
534
526
|
// We try to add a state that is already in cache (due to preserved flag) but with a different iapp-state
|
|
535
527
|
// --> we should delete the previous entry (it will be later replaced by the new one) and stop popping
|
|
536
|
-
oLastFocusControl = oTopState.oLastFocusControl;
|
|
537
528
|
oLastRemovedItem = this._oManagedHistory.pop();
|
|
538
529
|
iPopCount++;
|
|
539
530
|
oNewState.preserved = true;
|
|
@@ -565,7 +556,6 @@ sap.ui.define(
|
|
|
565
556
|
}
|
|
566
557
|
|
|
567
558
|
// 5. Now we can push the state at the top of the internal history
|
|
568
|
-
oNewState.oLastFocusControl = oLastFocusControl;
|
|
569
559
|
var bHasSameHash = oLastRemovedItem && oNewState.hash === oLastRemovedItem.hash;
|
|
570
560
|
if (this._oManagedHistory.length === 0 || this._oManagedHistory[this._oManagedHistory.length - 1].hash !== oNewState.hash) {
|
|
571
561
|
this._oManagedHistory.push(oNewState);
|
|
@@ -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/ui/core/UIComponent", "sap/fe/core/CommonUtils", "sap/base/Log"],
|
|
@@ -102,11 +102,11 @@ sap.ui.define(
|
|
|
102
102
|
return this.oAppComponent;
|
|
103
103
|
},
|
|
104
104
|
|
|
105
|
-
onPageReady: function(
|
|
105
|
+
onPageReady: function(mParameters) {
|
|
106
106
|
if (this.getRootControl() && this.getRootControl().getController() && this.getRootControl().getController().onPageReady) {
|
|
107
107
|
this.getRootControl()
|
|
108
108
|
.getController()
|
|
109
|
-
.onPageReady(
|
|
109
|
+
.onPageReady(mParameters);
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
|
|
@@ -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(["sap/base/Log", "sap/ui/base/Object", "sap/ui/model/json/JSONModel"], function(Log, BaseObject, JSONModel) {
|
|
6
6
|
"use strict";
|
|
@@ -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
|
[
|
|
@@ -114,13 +114,15 @@ sap.ui.define(
|
|
|
114
114
|
that._getMessageHandler().showMessageDialog();
|
|
115
115
|
|
|
116
116
|
if (oNewDocumentContext !== oContext) {
|
|
117
|
-
return that
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
return that
|
|
118
|
+
._handleNewContext(oNewDocumentContext, true, undefined, bDraftNavigation, true)
|
|
119
|
+
.then(function() {
|
|
120
|
+
if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
121
|
+
// The stickyOn handler must be set after the navigation has been done,
|
|
122
|
+
// as the URL may change in the case of FCL
|
|
123
|
+
that._handleStickyOn(oNewDocumentContext);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
});
|
|
@@ -507,18 +509,21 @@ sap.ui.define(
|
|
|
507
509
|
case CreationMode.Deferred:
|
|
508
510
|
oNavigation = oRoutingListener.navigateForwardToContext(oListBinding, {
|
|
509
511
|
bDeferredContext: true,
|
|
510
|
-
editable: true
|
|
512
|
+
editable: true,
|
|
513
|
+
bForceFocus: true
|
|
511
514
|
});
|
|
512
515
|
break;
|
|
513
516
|
case CreationMode.Async:
|
|
514
517
|
oNavigation = oRoutingListener.navigateForwardToContext(oListBinding, {
|
|
515
518
|
asyncContext: oCreation,
|
|
516
|
-
editable: true
|
|
519
|
+
editable: true,
|
|
520
|
+
bForceFocus: true
|
|
517
521
|
});
|
|
518
522
|
break;
|
|
519
523
|
case CreationMode.Sync:
|
|
520
524
|
mArgs = {
|
|
521
|
-
editable: true
|
|
525
|
+
editable: true,
|
|
526
|
+
bForceFocus: true
|
|
522
527
|
};
|
|
523
528
|
if (sProgrammingModel == ProgrammingModel.Sticky || mParameters.createAction) {
|
|
524
529
|
mArgs.transient = true;
|
|
@@ -712,7 +717,7 @@ sap.ui.define(
|
|
|
712
717
|
that._getMessageHandler().showMessageDialog();
|
|
713
718
|
|
|
714
719
|
if (oActiveDocumentContext !== oContext) {
|
|
715
|
-
that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation);
|
|
720
|
+
that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation, true);
|
|
716
721
|
}
|
|
717
722
|
})
|
|
718
723
|
.catch(function(oError) {
|
|
@@ -762,7 +767,7 @@ sap.ui.define(
|
|
|
762
767
|
})
|
|
763
768
|
.then(function(oToggleContext) {
|
|
764
769
|
that._setEditMode(bEditable ? EditMode.Editable : EditMode.Display, false); //switch to edit mode only if a draft is available
|
|
765
|
-
that._handleNewContext(oToggleContext, bEditable, true, true);
|
|
770
|
+
that._handleNewContext(oToggleContext, bEditable, true, true, true);
|
|
766
771
|
})
|
|
767
772
|
.catch(function(err) {
|
|
768
773
|
return Promise.reject("Error in EditFlow.toggleDraftActive:" + err);
|
|
@@ -828,12 +833,12 @@ sap.ui.define(
|
|
|
828
833
|
if (mParameters.bSkipBindingToView) {
|
|
829
834
|
return oActiveDocumentContext;
|
|
830
835
|
} else {
|
|
831
|
-
return that._handleNewContext(oActiveDocumentContext, false, true, bDraftNavigation);
|
|
836
|
+
return that._handleNewContext(oActiveDocumentContext, false, true, bDraftNavigation, true);
|
|
832
837
|
}
|
|
833
838
|
});
|
|
834
839
|
} else {
|
|
835
840
|
//active context is returned in case of cancel of existing document
|
|
836
|
-
return that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation);
|
|
841
|
+
return that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation, true);
|
|
837
842
|
}
|
|
838
843
|
});
|
|
839
844
|
},
|
|
@@ -1501,7 +1506,7 @@ sap.ui.define(
|
|
|
1501
1506
|
}
|
|
1502
1507
|
},
|
|
1503
1508
|
|
|
1504
|
-
_handleNewContext: function(oContext, bEditable, bRecreateContext, bDraftNavigation) {
|
|
1509
|
+
_handleNewContext: function(oContext, bEditable, bRecreateContext, bDraftNavigation, bForceFocus) {
|
|
1505
1510
|
EditState.setEditStateDirty();
|
|
1506
1511
|
|
|
1507
1512
|
return this._getRoutingListener().navigateToContext(oContext, {
|
|
@@ -1510,7 +1515,8 @@ sap.ui.define(
|
|
|
1510
1515
|
bPersistOPScroll: true,
|
|
1511
1516
|
bRecreateContext: bRecreateContext,
|
|
1512
1517
|
bDraftNavigation: bDraftNavigation,
|
|
1513
|
-
showPlaceholder: false
|
|
1518
|
+
showPlaceholder: false,
|
|
1519
|
+
bForceFocus: bForceFocus
|
|
1514
1520
|
});
|
|
1515
1521
|
},
|
|
1516
1522
|
|