@sapui5/sap.fe.core 1.92.0 → 1.93.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 +2 -3
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +2 -2
- package/src/sap/fe/core/AppComponent.js +21 -1
- package/src/sap/fe/core/CommonUtils.js +130 -48
- package/src/sap/fe/core/ExtensionAPI.js +238 -226
- package/src/sap/fe/core/PageController.js +5 -2
- package/src/sap/fe/core/TemplateComponent.js +1 -0
- package/src/sap/fe/core/TransactionHelper.js +35 -8
- package/src/sap/fe/core/actions/draft.js +1 -1
- package/src/sap/fe/core/actions/messageHandling.js +18 -6
- package/src/sap/fe/core/actions/operations.js +17 -41
- package/src/sap/fe/core/controllerextensions/EditFlow.js +127 -43
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +11 -11
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +417 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +399 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +102 -66
- package/src/sap/fe/core/controllerextensions/SideEffects.js +60 -14
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +53 -12
- package/src/sap/fe/core/controllerextensions/ViewState.js +18 -18
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +13 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +68 -2
- package/src/sap/fe/core/converters/ConverterContext.js +15 -1
- package/src/sap/fe/core/converters/ConverterContext.ts +11 -0
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -2
- package/src/sap/fe/core/converters/ManifestWrapper.js +14 -14
- package/src/sap/fe/core/converters/ManifestWrapper.ts +13 -12
- package/src/sap/fe/core/converters/MetaModelConverter.js +32 -2
- package/src/sap/fe/core/converters/MetaModelConverter.ts +39 -2
- package/src/sap/fe/core/converters/annotations/DataField.js +10 -6
- package/src/sap/fe/core/converters/annotations/DataField.ts +9 -5
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +14 -4
- package/src/sap/fe/core/converters/controls/Common/Action.js +25 -15
- package/src/sap/fe/core/converters/controls/Common/Action.ts +33 -19
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +50 -0
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +33 -0
- package/src/sap/fe/core/converters/controls/Common/Form.js +2 -3
- package/src/sap/fe/core/converters/controls/Common/Form.ts +1 -2
- package/src/sap/fe/core/converters/controls/Common/KPI.js +181 -0
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +220 -0
- package/src/sap/fe/core/converters/controls/Common/Table.js +121 -59
- package/src/sap/fe/core/converters/controls/Common/Table.ts +130 -62
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +5 -4
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +9 -3
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +62 -7
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +58 -6
- package/src/sap/fe/core/converters/helpers/Aggregation.js +86 -11
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +79 -8
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +44 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +43 -2
- package/src/sap/fe/core/converters/helpers/ID.js +3 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +1 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +8 -2
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +7 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +93 -0
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +92 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +102 -23
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +111 -17
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +44 -5
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +39 -2
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +41 -30
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +47 -30
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +77 -0
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +58 -0
- package/src/sap/fe/core/formatters/KPIFormatter.js +103 -0
- package/src/sap/fe/core/formatters/KPIFormatter.ts +88 -0
- package/src/sap/fe/core/fpm/manifest.json +1 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +161 -97
- package/src/sap/fe/core/helpers/BindingExpression.ts +188 -117
- package/src/sap/fe/core/library.js +1 -1
- package/src/sap/fe/core/messagebundle.properties +45 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +3 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +30 -8
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +16 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +13 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +7 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +7 -2
- package/src/sap/fe/core/templating/UIFormatters.js +1 -5
- package/src/sap/fe/core/templating/UIFormatters.ts +0 -3
|
@@ -15,9 +15,10 @@ sap.ui.define(
|
|
|
15
15
|
"sap/ui/model/Filter",
|
|
16
16
|
"sap/ui/model/FilterOperator",
|
|
17
17
|
"sap/ui/core/message/Message",
|
|
18
|
-
"sap/ui/core/IconPool"
|
|
18
|
+
"sap/ui/core/IconPool",
|
|
19
|
+
"sap/ui/model/json/JSONModel"
|
|
19
20
|
],
|
|
20
|
-
function(MessageToast, MessageItem, MessageView, Button, Dialog, CoreLib, Filter, FilterOperator, Message, IconPool) {
|
|
21
|
+
function(MessageToast, MessageItem, MessageView, Button, Dialog, CoreLib, Filter, FilterOperator, Message, IconPool, JSONModel) {
|
|
21
22
|
"use strict";
|
|
22
23
|
var MessageType = CoreLib.MessageType;
|
|
23
24
|
var that = this;
|
|
@@ -154,7 +155,10 @@ sap.ui.define(
|
|
|
154
155
|
oMessageManager = sap.ui.getCore().getMessageManager(),
|
|
155
156
|
sHighestPriority,
|
|
156
157
|
sHighestPriorityText,
|
|
157
|
-
aFilters = [
|
|
158
|
+
aFilters = [
|
|
159
|
+
new Filter({ path: "code", operator: FilterOperator.NE, value1: null }),
|
|
160
|
+
new Filter({ path: "persistent", operator: FilterOperator.NE, value1: false })
|
|
161
|
+
],
|
|
158
162
|
showMessageDialog = false;
|
|
159
163
|
|
|
160
164
|
if (bShowBoundTransition) {
|
|
@@ -213,10 +217,19 @@ sap.ui.define(
|
|
|
213
217
|
});
|
|
214
218
|
}
|
|
215
219
|
var oListBinding = oMessageManager.getMessageModel().bindList("/", undefined, undefined, aFilters),
|
|
216
|
-
aCurrentContexts = oListBinding.getCurrentContexts()
|
|
220
|
+
aCurrentContexts = oListBinding.getCurrentContexts(),
|
|
221
|
+
oMessageDialogModel = new JSONModel();
|
|
217
222
|
if (aCurrentContexts && aCurrentContexts.length > 0) {
|
|
218
223
|
// Don't show dialog incase there are no errors to show
|
|
219
224
|
showMessageDialog = true;
|
|
225
|
+
// As fitering has already happened here hence
|
|
226
|
+
// using the message model again for the message dialog view and then filtering on that binding again is unnecessary.
|
|
227
|
+
// So we create new json model to use for the message dialog view.
|
|
228
|
+
var aMessages = [];
|
|
229
|
+
aCurrentContexts.forEach(function(oContext) {
|
|
230
|
+
aMessages.push(oContext.getObject());
|
|
231
|
+
});
|
|
232
|
+
oMessageDialogModel.setData(aMessages);
|
|
220
233
|
}
|
|
221
234
|
if (aUnboundMessages.length === 0 && !aCustomMessages && !bHasEtagMessage) {
|
|
222
235
|
// Don't show the popup if there are no transient messages
|
|
@@ -263,7 +276,6 @@ sap.ui.define(
|
|
|
263
276
|
},
|
|
264
277
|
items: {
|
|
265
278
|
path: "/",
|
|
266
|
-
filters: aFilters,
|
|
267
279
|
template: that.oMessageTemplate
|
|
268
280
|
}
|
|
269
281
|
});
|
|
@@ -277,7 +289,7 @@ sap.ui.define(
|
|
|
277
289
|
this.setVisible(false);
|
|
278
290
|
}
|
|
279
291
|
});
|
|
280
|
-
that.oMessageView.setModel(
|
|
292
|
+
that.oMessageView.setModel(oMessageDialogModel);
|
|
281
293
|
that.oDialog =
|
|
282
294
|
that.oDialog ||
|
|
283
295
|
new Dialog({
|
|
@@ -336,24 +336,6 @@ sap.ui.define(
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
function _isSingleton(sPath, oMetaModel) {
|
|
340
|
-
if (!sPath || !oMetaModel) {
|
|
341
|
-
return false;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Find the underlying entity set from the property path and check whether it is a singleton.
|
|
345
|
-
// In order to do it,
|
|
346
|
-
// split the path on '/',
|
|
347
|
-
// remove the last entry (property name) and
|
|
348
|
-
// join the remaining parts to form the navigation path
|
|
349
|
-
var sNavigationPath = sPath
|
|
350
|
-
.split("/")
|
|
351
|
-
.slice(0, -1)
|
|
352
|
-
.join("/"),
|
|
353
|
-
oEntitySet = sNavigationPath && oMetaModel.getObject("/" + sNavigationPath);
|
|
354
|
-
return (oEntitySet && oEntitySet.$kind === "Singleton") || false;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
339
|
function showActionParameterDialog(
|
|
358
340
|
sActionName,
|
|
359
341
|
oAppComponent,
|
|
@@ -458,8 +440,6 @@ sap.ui.define(
|
|
|
458
440
|
validateRequiredProperties()
|
|
459
441
|
.then(function(aEmptyMandatoryFields) {
|
|
460
442
|
if (aEmptyMandatoryFields.length) {
|
|
461
|
-
var oMessageManager = sap.ui.getCore().getMessageManager();
|
|
462
|
-
oMessageManager.removeAllMessages();
|
|
463
443
|
var oMessages = [];
|
|
464
444
|
for (var i = 0; i < aEmptyMandatoryFields.length; i++) {
|
|
465
445
|
oMessages.push({
|
|
@@ -571,28 +551,21 @@ sap.ui.define(
|
|
|
571
551
|
var prefillParameter = function(sParamName, vParamDefaultValue) {
|
|
572
552
|
return new Promise(function(resolve, reject) {
|
|
573
553
|
// Case 1: There is a ParameterDefaultValue annotation
|
|
574
|
-
if (vParamDefaultValue) {
|
|
554
|
+
if (vParamDefaultValue !== undefined) {
|
|
575
555
|
if (aContexts.length > 0 && vParamDefaultValue.$Path) {
|
|
576
|
-
var oPromise
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
vParamDefaultValue.$Path,
|
|
581
|
-
oOperationBinding.getModel().getMetaModel()
|
|
582
|
-
)
|
|
583
|
-
) {
|
|
584
|
-
//request value and resolve
|
|
585
|
-
var oPropertyBinding = oOperationBinding
|
|
586
|
-
.getModel()
|
|
587
|
-
.bindProperty("/" + vParamDefaultValue.$Path);
|
|
588
|
-
oPromise = oPropertyBinding.requestValue();
|
|
589
|
-
} else {
|
|
590
|
-
// Case 1.1: ParameterDefaultValue points to a path (i.e. vParamDefaultValue = { $Path: 'somePath' })
|
|
591
|
-
oPromise = oOperationBinding
|
|
592
|
-
.getParameterContext()
|
|
593
|
-
.requestProperty(vParamDefaultValue.$Path);
|
|
594
|
-
}
|
|
556
|
+
var oPromise = CommonUtils.requestSingletonProperty(
|
|
557
|
+
vParamDefaultValue.$Path,
|
|
558
|
+
oOperationBinding.getModel()
|
|
559
|
+
);
|
|
595
560
|
oPromise
|
|
561
|
+
.then(function(oValue) {
|
|
562
|
+
if (oValue === null) {
|
|
563
|
+
return oOperationBinding
|
|
564
|
+
.getParameterContext()
|
|
565
|
+
.requestProperty(vParamDefaultValue.$Path);
|
|
566
|
+
}
|
|
567
|
+
return oValue;
|
|
568
|
+
})
|
|
596
569
|
.then(function(vParamValue) {
|
|
597
570
|
if (aContexts.length > 1) {
|
|
598
571
|
// For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
|
|
@@ -734,7 +707,10 @@ sap.ui.define(
|
|
|
734
707
|
aActionParameters[i].$Name,
|
|
735
708
|
oFunctionParamsFromManifest[sDialogParamName]
|
|
736
709
|
);
|
|
737
|
-
} else if (
|
|
710
|
+
} else if (
|
|
711
|
+
aCurrentParamDefaultValue[i] &&
|
|
712
|
+
aCurrentParamDefaultValue[i].value !== undefined
|
|
713
|
+
) {
|
|
738
714
|
oOperationBinding.setParameter(
|
|
739
715
|
aActionParameters[i].$Name,
|
|
740
716
|
aCurrentParamDefaultValue[i].value
|
|
@@ -17,7 +17,9 @@ sap.ui.define(
|
|
|
17
17
|
"sap/ui/model/odata/v4/ODataListBinding",
|
|
18
18
|
"sap/fe/core/helpers/SemanticKeyHelper",
|
|
19
19
|
"sap/fe/core/helpers/EditState",
|
|
20
|
-
"sap/fe/core/helpers/FPMHelper"
|
|
20
|
+
"sap/fe/core/helpers/FPMHelper",
|
|
21
|
+
"sap/ui/core/message/Message",
|
|
22
|
+
"sap/ui/core/MessageType"
|
|
21
23
|
],
|
|
22
24
|
function(
|
|
23
25
|
ControllerExtension,
|
|
@@ -33,7 +35,9 @@ sap.ui.define(
|
|
|
33
35
|
ODataListBinding,
|
|
34
36
|
SemanticKeyHelper,
|
|
35
37
|
EditState,
|
|
36
|
-
FPMHelper
|
|
38
|
+
FPMHelper,
|
|
39
|
+
Message,
|
|
40
|
+
MessageType
|
|
37
41
|
) {
|
|
38
42
|
"use strict";
|
|
39
43
|
|
|
@@ -66,7 +70,7 @@ sap.ui.define(
|
|
|
66
70
|
invokeAction: { "public": true, "final": true },
|
|
67
71
|
securedExecution: { "public": true, "final": true },
|
|
68
72
|
|
|
69
|
-
onBeforeSave: { "public":
|
|
73
|
+
onBeforeSave: { "public": true, "final": false, "overrideExecution": OverrideExecution.Instead }
|
|
70
74
|
}
|
|
71
75
|
},
|
|
72
76
|
|
|
@@ -104,17 +108,19 @@ sap.ui.define(
|
|
|
104
108
|
if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
105
109
|
that._getInternalModel().setProperty("/sessionOn", true);
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
if (oNewDocumentContext) {
|
|
112
|
+
that._setEditMode(EditMode.Editable, false);
|
|
113
|
+
that._getMessageHandler().showMessageDialog();
|
|
109
114
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
if (oNewDocumentContext !== oContext) {
|
|
116
|
+
return that._handleNewContext(oNewDocumentContext, true, undefined, bDraftNavigation).then(function() {
|
|
117
|
+
if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
118
|
+
// The stickyOn handler must be set after the navigation has been done,
|
|
119
|
+
// as the URL may change in the case of FCL
|
|
120
|
+
that._handleStickyOn(oNewDocumentContext);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
118
124
|
}
|
|
119
125
|
});
|
|
120
126
|
},
|
|
@@ -179,6 +185,9 @@ sap.ui.define(
|
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
)
|
|
188
|
+
.catch(function(oError) {
|
|
189
|
+
Log.error("Error while updating the document", oError);
|
|
190
|
+
})
|
|
182
191
|
.finally(function() {
|
|
183
192
|
that._getMessageHandler().showMessageDialog();
|
|
184
193
|
});
|
|
@@ -212,14 +221,14 @@ sap.ui.define(
|
|
|
212
221
|
transactionHelper = this._getTransactionHelper(),
|
|
213
222
|
oLockObject = this._getGlobalUIModel(),
|
|
214
223
|
oTable,
|
|
215
|
-
iCountTableItems,
|
|
224
|
+
iCountTableItems = 0,
|
|
216
225
|
oResourceBundle = that.getView().getController().oResourceBundle,
|
|
217
226
|
bShouldBusyLock =
|
|
218
227
|
!mParameters ||
|
|
219
228
|
(mParameters.creationMode !== CreationMode.Inline &&
|
|
220
229
|
mParameters.creationMode !== CreationMode.CreationRow &&
|
|
221
230
|
mParameters.creationMode !== CreationMode.External),
|
|
222
|
-
oExecFunctionFromManifestPromise = Promise.resolve(
|
|
231
|
+
oExecFunctionFromManifestPromise = Promise.resolve([]),
|
|
223
232
|
oAppComponent = CommonUtils.getAppComponent(this.getView());
|
|
224
233
|
oAppComponent.getRouterProxy().removeIAppStateKey();
|
|
225
234
|
|
|
@@ -292,32 +301,91 @@ sap.ui.define(
|
|
|
292
301
|
Log.error("Error while creating the document", oError);
|
|
293
302
|
});
|
|
294
303
|
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @param {Array} aValidationMessages Error messages from custom validation function
|
|
307
|
+
*/
|
|
308
|
+
function createCustomValidationMessages(aValidationMessages) {
|
|
309
|
+
var sCustomValidationFunction = oTable && oTable.getCreationRow().data("customValidationFunction"),
|
|
310
|
+
mCustomValidity = oTable && oTable.getBindingContext("internal").getProperty("creationRowCustomValidity"),
|
|
311
|
+
oMessageManager = sap.ui.getCore().getMessageManager(),
|
|
312
|
+
aCustomMessages = [],
|
|
313
|
+
oFieldControl,
|
|
314
|
+
sTarget;
|
|
315
|
+
|
|
316
|
+
// Remove existing CustomValidation message
|
|
317
|
+
oMessageManager
|
|
318
|
+
.getMessageModel()
|
|
319
|
+
.getData()
|
|
320
|
+
.forEach(function(oMessage) {
|
|
321
|
+
if (oMessage.code === sCustomValidationFunction) {
|
|
322
|
+
oMessageManager.removeMessages(oMessage);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
aValidationMessages.forEach(function(oValidationMessage) {
|
|
327
|
+
// Handle Bound CustomValidation message
|
|
328
|
+
if (oValidationMessage.messageTarget) {
|
|
329
|
+
oFieldControl = sap.ui.getCore().getControl(mCustomValidity[oValidationMessage.messageTarget].fieldId);
|
|
330
|
+
sTarget = oFieldControl.getBindingContext().getPath() + "/" + oFieldControl.getBindingPath("value");
|
|
331
|
+
// Add validation message if still not exists
|
|
332
|
+
if (
|
|
333
|
+
oMessageManager
|
|
334
|
+
.getMessageModel()
|
|
335
|
+
.getData()
|
|
336
|
+
.filter(function(oMessage) {
|
|
337
|
+
return oMessage.target === sTarget;
|
|
338
|
+
}).length === 0
|
|
339
|
+
) {
|
|
340
|
+
oMessageManager.addMessages(
|
|
341
|
+
new Message({
|
|
342
|
+
message: oValidationMessage.messageText,
|
|
343
|
+
processor: that.getView().getModel(),
|
|
344
|
+
type: MessageType.Error,
|
|
345
|
+
code: sCustomValidationFunction,
|
|
346
|
+
technical: false,
|
|
347
|
+
persistent: false,
|
|
348
|
+
target: sTarget
|
|
349
|
+
})
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
// Add controlId in order to get the focus handling of the error popover runable
|
|
353
|
+
var aExistingValidationMessages = oMessageManager
|
|
354
|
+
.getMessageModel()
|
|
355
|
+
.getData()
|
|
356
|
+
.filter(function(oMessage) {
|
|
357
|
+
return oMessage.target === sTarget;
|
|
358
|
+
});
|
|
359
|
+
aExistingValidationMessages[0].addControlId(mCustomValidity[oValidationMessage.messageTarget].fieldId);
|
|
360
|
+
|
|
361
|
+
// Handle Unbound CustomValidation message
|
|
362
|
+
} else {
|
|
363
|
+
aCustomMessages.push({
|
|
364
|
+
code: sCustomValidationFunction,
|
|
365
|
+
text: oValidationMessage.messageText,
|
|
366
|
+
persistent: true,
|
|
367
|
+
type: MessageType.Error
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
if (aCustomMessages.length > 0) {
|
|
373
|
+
that._getMessageHandler().showMessageDialog({
|
|
374
|
+
customMessages: aCustomMessages
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
295
379
|
bShouldBusyLock && BusyLocker.lock(oLockObject);
|
|
296
380
|
return this._syncTask(oExecFunctionFromManifestPromise)
|
|
297
381
|
.then(function(aValidationMessages) {
|
|
298
382
|
if (aValidationMessages.length > 0) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
text: oMessage.messageText,
|
|
304
|
-
target: oMessage.messageTarget,
|
|
305
|
-
code: 200,
|
|
306
|
-
persistent: false,
|
|
307
|
-
type: "Error"
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
that._getMessageHandler().showMessageDialog({
|
|
311
|
-
customMessages: oCustomMessages
|
|
312
|
-
});
|
|
313
|
-
// if validation error prevent row creation
|
|
314
|
-
bShouldBusyLock && BusyLocker.unlock(oLockObject);
|
|
315
|
-
return Promise.reject();
|
|
316
|
-
} else {
|
|
317
|
-
return Promise.resolve();
|
|
383
|
+
createCustomValidationMessages(aValidationMessages);
|
|
384
|
+
Log.error("Custom Validation failed");
|
|
385
|
+
// if custom validation fails, we leave the method immediately
|
|
386
|
+
return;
|
|
318
387
|
}
|
|
319
|
-
|
|
320
|
-
.then(function() {
|
|
388
|
+
|
|
321
389
|
var sProgrammingModel, oListBinding, oModel;
|
|
322
390
|
|
|
323
391
|
mParameters = mParameters || {};
|
|
@@ -500,10 +568,17 @@ sap.ui.define(
|
|
|
500
568
|
if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
501
569
|
that._getInternalModel().setProperty("/sessionOn", true);
|
|
502
570
|
}
|
|
571
|
+
var bIsNewPageCreation =
|
|
572
|
+
mParameters.creationMode !== CreationMode.CreationRow &&
|
|
573
|
+
mParameters.creationMode !== CreationMode.Inline;
|
|
503
574
|
if (oCreation) {
|
|
504
575
|
return Promise.all([oCreation, oNavigation])
|
|
505
576
|
.then(function(aParams) {
|
|
506
|
-
|
|
577
|
+
if (bIsNewPageCreation) {
|
|
578
|
+
that._setEditMode(EditMode.Editable, bIsNewPageCreation);
|
|
579
|
+
} else {
|
|
580
|
+
that._setEditMode(EditMode.Editable);
|
|
581
|
+
}
|
|
507
582
|
var oNewDocumentContext = aParams[0];
|
|
508
583
|
if (oNewDocumentContext) {
|
|
509
584
|
EditState.setEditStateDirty();
|
|
@@ -601,7 +676,7 @@ sap.ui.define(
|
|
|
601
676
|
.then(this._submitOpenChanges.bind(this, oContext))
|
|
602
677
|
// check if there are any validation/parse errors
|
|
603
678
|
.then(this._checkForValidationErrors.bind(this, oContext))
|
|
604
|
-
.then(this.onBeforeSave.bind(this))
|
|
679
|
+
.then(this.base.editFlow.onBeforeSave.bind(this))
|
|
605
680
|
// and finally if all user changes are submitted and valid save the document
|
|
606
681
|
.then(
|
|
607
682
|
transactionHelper.saveDocument.bind(
|
|
@@ -777,6 +852,7 @@ sap.ui.define(
|
|
|
777
852
|
*/
|
|
778
853
|
deleteDocument: function(oContext, mParameters) {
|
|
779
854
|
var that = this;
|
|
855
|
+
var oAppComponent = CommonUtils.getAppComponent(that.getView());
|
|
780
856
|
if (!mParameters) {
|
|
781
857
|
mParameters = {
|
|
782
858
|
bFindActiveContexts: false
|
|
@@ -790,6 +866,10 @@ sap.ui.define(
|
|
|
790
866
|
EditState.setEditStateDirty();
|
|
791
867
|
|
|
792
868
|
that._getRoutingListener().navigateBackFromContext(oContext);
|
|
869
|
+
// After delete is successfull, we need to dettch the setBackNavigation Methods
|
|
870
|
+
if (oAppComponent) {
|
|
871
|
+
oAppComponent.getShellServices().setBackNavigation();
|
|
872
|
+
}
|
|
793
873
|
});
|
|
794
874
|
},
|
|
795
875
|
|
|
@@ -889,6 +969,8 @@ sap.ui.define(
|
|
|
889
969
|
// TODO: currently this selected contexts update is done within the operation, should be moved out
|
|
890
970
|
mParameters.internalModelContext = oTable.getBindingContext("internal");
|
|
891
971
|
}
|
|
972
|
+
} else {
|
|
973
|
+
mParameters.internalModelContext = oView.getBindingContext("internal");
|
|
892
974
|
}
|
|
893
975
|
|
|
894
976
|
if (sActionName && sActionName.indexOf("(") > -1) {
|
|
@@ -965,11 +1047,13 @@ sap.ui.define(
|
|
|
965
1047
|
.then(function(oResponse) {
|
|
966
1048
|
// if the returned context for the bound action is different than the context on which action was called,
|
|
967
1049
|
// refresh the corresponding list binding
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1050
|
+
if (mParameters.contexts) {
|
|
1051
|
+
return that
|
|
1052
|
+
._refreshListIfRequired(that._getActionResponseDataAndKeys(sActionName, oResponse), mParameters.contexts[0])
|
|
1053
|
+
.then(function() {
|
|
1054
|
+
return oResponse;
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
973
1057
|
})
|
|
974
1058
|
.then(function(oResponse) {
|
|
975
1059
|
if (oCurrentActionCallBacks) {
|
|
@@ -216,22 +216,22 @@ sap.ui.define(
|
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
/**
|
|
219
|
-
* Triggered
|
|
219
|
+
* Triggered every time this controller is a navigation target.
|
|
220
220
|
*/
|
|
221
221
|
onRouteMatched: function() {},
|
|
222
222
|
onRouteMatchedFinished: function() {},
|
|
223
223
|
onBeforeBinding: function(oBindingContext, mParameters) {
|
|
224
|
-
this.base
|
|
225
|
-
|
|
226
|
-
.
|
|
227
|
-
|
|
224
|
+
var oRouting = this.base.getView().getController().routing;
|
|
225
|
+
if (oRouting && oRouting.onBeforeBinding) {
|
|
226
|
+
oRouting.onBeforeBinding(oBindingContext, mParameters);
|
|
227
|
+
}
|
|
228
228
|
},
|
|
229
229
|
onAfterBinding: function(oBindingContext, mParameters) {
|
|
230
230
|
this._oAppComponent.getRootViewController().onContextBoundToView(oBindingContext);
|
|
231
|
-
this.base
|
|
232
|
-
|
|
233
|
-
.
|
|
234
|
-
|
|
231
|
+
var oRouting = this.base.getView().getController().routing;
|
|
232
|
+
if (oRouting && oRouting.onAfterBinding) {
|
|
233
|
+
oRouting.onAfterBinding(oBindingContext, mParameters);
|
|
234
|
+
}
|
|
235
235
|
},
|
|
236
236
|
|
|
237
237
|
///////////////////////////////////////////////////////////
|
|
@@ -240,7 +240,7 @@ sap.ui.define(
|
|
|
240
240
|
///////////////////////////////////////////////////////////
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
*
|
|
243
|
+
* Navigates to the specified navigation target.
|
|
244
244
|
* @param {sap.ui.model.odata.v4.Context} oContext Context instance
|
|
245
245
|
* @param {string} sNavigationTargetName Navigation target name
|
|
246
246
|
* @param oSemanticObject
|
|
@@ -944,7 +944,7 @@ sap.ui.define(
|
|
|
944
944
|
|
|
945
945
|
override: {
|
|
946
946
|
onExit: function() {
|
|
947
|
-
this._oRoutingService.detachRouteMatched(this._fnRouteMatchedBound);
|
|
947
|
+
this._oRoutingService && this._oRoutingService.detachRouteMatched(this._fnRouteMatchedBound);
|
|
948
948
|
},
|
|
949
949
|
onInit: function() {
|
|
950
950
|
var that = this;
|