@sapui5/sap.fe.core 1.97.0 → 1.99.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/package.json +5 -4
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +377 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +385 -0
  5. package/src/sap/fe/core/AppComponent.js +6 -3
  6. package/src/sap/fe/core/AppStateHandler.js +229 -181
  7. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  8. package/src/sap/fe/core/BaseController.js +3 -2
  9. package/src/sap/fe/core/BusyLocker.js +105 -121
  10. package/src/sap/fe/core/BusyLocker.ts +98 -0
  11. package/src/sap/fe/core/CommonUtils.js +2073 -2379
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +16 -7
  14. package/src/sap/fe/core/PageController.js +84 -119
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -807
  17. package/src/sap/fe/core/RouterProxy.ts +838 -0
  18. package/src/sap/fe/core/Synchronization.js +51 -35
  19. package/src/sap/fe/core/Synchronization.ts +29 -0
  20. package/src/sap/fe/core/TemplateComponent.js +173 -155
  21. package/src/sap/fe/core/TemplateComponent.ts +166 -0
  22. package/src/sap/fe/core/TemplateModel.js +97 -54
  23. package/src/sap/fe/core/TemplateModel.ts +64 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1579
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +560 -581
  27. package/src/sap/fe/core/actions/draft.ts +594 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -511
  29. package/src/sap/fe/core/actions/messageHandling.ts +532 -0
  30. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  31. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  32. package/src/sap/fe/core/actions/operations.js +1074 -1211
  33. package/src/sap/fe/core/actions/operations.ts +1162 -0
  34. package/src/sap/fe/core/actions/sticky.js +102 -105
  35. package/src/sap/fe/core/actions/sticky.ts +102 -0
  36. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
  37. package/src/sap/fe/core/controllerextensions/EditFlow.js +229 -260
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -23
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
  50. package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +22 -8
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
  56. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
  57. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  58. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  59. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  60. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
  61. package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
  62. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  63. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
  64. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  65. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  66. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  67. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  68. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  69. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  70. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  71. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  72. package/src/sap/fe/core/converters/ConverterContext.js +14 -2
  73. package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
  74. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  75. package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
  76. package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
  77. package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
  78. package/src/sap/fe/core/converters/MetaModelConverter.js +67 -6
  79. package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
  80. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  81. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  82. package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
  83. package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
  84. package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
  85. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  86. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  87. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  88. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  89. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  90. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  91. package/src/sap/fe/core/converters/controls/Common/Form.js +20 -10
  92. package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
  93. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  94. package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
  95. package/src/sap/fe/core/converters/controls/Common/Table.js +390 -398
  96. package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
  97. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
  98. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
  99. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
  100. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
  101. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  102. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  103. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
  104. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  105. package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
  106. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  107. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  108. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  109. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  110. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  111. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  112. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  113. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
  114. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  116. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  117. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  118. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  119. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  120. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  121. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  122. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  123. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  124. package/src/sap/fe/core/fpm/Component.js +3 -2
  125. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  126. package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
  127. package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
  128. package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
  129. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  130. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  131. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  132. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  133. package/src/sap/fe/core/helpers/EditState.js +81 -84
  134. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  135. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  136. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  137. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  138. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  139. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  140. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  141. package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
  142. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  143. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  144. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  145. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  146. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  147. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  148. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  149. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  150. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  151. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  152. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  153. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  154. package/src/sap/fe/core/library.js +30 -3
  155. package/src/sap/fe/core/library.support.js +12 -5
  156. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  157. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  158. package/src/sap/fe/core/messagebundle.properties +61 -13
  159. package/src/sap/fe/core/messagebundle_ar.properties +33 -2
  160. package/src/sap/fe/core/messagebundle_bg.properties +33 -2
  161. package/src/sap/fe/core/messagebundle_ca.properties +33 -2
  162. package/src/sap/fe/core/messagebundle_cs.properties +34 -3
  163. package/src/sap/fe/core/messagebundle_cy.properties +33 -2
  164. package/src/sap/fe/core/messagebundle_da.properties +33 -2
  165. package/src/sap/fe/core/messagebundle_de.properties +33 -2
  166. package/src/sap/fe/core/messagebundle_el.properties +33 -2
  167. package/src/sap/fe/core/messagebundle_en.properties +32 -1
  168. package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
  169. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
  170. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
  171. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
  172. package/src/sap/fe/core/messagebundle_es.properties +33 -2
  173. package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
  174. package/src/sap/fe/core/messagebundle_et.properties +33 -2
  175. package/src/sap/fe/core/messagebundle_fi.properties +34 -3
  176. package/src/sap/fe/core/messagebundle_fr.properties +38 -7
  177. package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
  178. package/src/sap/fe/core/messagebundle_hi.properties +33 -2
  179. package/src/sap/fe/core/messagebundle_hr.properties +33 -2
  180. package/src/sap/fe/core/messagebundle_hu.properties +34 -3
  181. package/src/sap/fe/core/messagebundle_id.properties +36 -5
  182. package/src/sap/fe/core/messagebundle_it.properties +33 -2
  183. package/src/sap/fe/core/messagebundle_iw.properties +33 -2
  184. package/src/sap/fe/core/messagebundle_ja.properties +33 -2
  185. package/src/sap/fe/core/messagebundle_kk.properties +33 -2
  186. package/src/sap/fe/core/messagebundle_ko.properties +33 -2
  187. package/src/sap/fe/core/messagebundle_lt.properties +33 -2
  188. package/src/sap/fe/core/messagebundle_lv.properties +33 -2
  189. package/src/sap/fe/core/messagebundle_ms.properties +33 -2
  190. package/src/sap/fe/core/messagebundle_nl.properties +33 -2
  191. package/src/sap/fe/core/messagebundle_no.properties +33 -2
  192. package/src/sap/fe/core/messagebundle_pl.properties +33 -2
  193. package/src/sap/fe/core/messagebundle_pt.properties +34 -3
  194. package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
  195. package/src/sap/fe/core/messagebundle_ro.properties +33 -2
  196. package/src/sap/fe/core/messagebundle_ru.properties +33 -2
  197. package/src/sap/fe/core/messagebundle_sh.properties +33 -2
  198. package/src/sap/fe/core/messagebundle_sk.properties +33 -2
  199. package/src/sap/fe/core/messagebundle_sl.properties +33 -2
  200. package/src/sap/fe/core/messagebundle_sv.properties +34 -3
  201. package/src/sap/fe/core/messagebundle_th.properties +33 -2
  202. package/src/sap/fe/core/messagebundle_tr.properties +33 -2
  203. package/src/sap/fe/core/messagebundle_uk.properties +33 -2
  204. package/src/sap/fe/core/messagebundle_vi.properties +33 -2
  205. package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
  206. package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
  207. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  208. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  209. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  210. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  211. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  212. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
  213. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  214. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  215. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  216. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  217. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
  218. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  219. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  220. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
  221. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
  222. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
  223. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
  224. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  225. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  226. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  227. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  228. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  229. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  230. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  231. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  232. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  233. package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
  234. package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
  235. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  236. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  237. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  238. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  239. package/src/sap/fe/core/templating/FilterHelper.js +139 -70
  240. package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
  241. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  242. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  243. package/src/sap/fe/core/templating/UIFormatters.js +45 -110
  244. package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
  245. package/src/sap/fe/core/type/Email.js +1 -1
  246. package/src/sap/fe/core/type/Email.ts +4 -6
  247. package/ui5.yaml +0 -3
  248. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  249. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ (c) Copyright 2009-2021 SAP SE. All rights reserved
4
+
4
5
  */
5
6
  sap.ui.define(
6
7
  [
7
8
  "sap/ui/core/mvc/ControllerExtension",
8
9
  "sap/ui/core/mvc/OverrideExecution",
9
- "sap/fe/core/actions/sticky",
10
10
  "sap/base/Log",
11
11
  "sap/m/Text",
12
12
  "sap/m/Button",
@@ -25,7 +25,6 @@ sap.ui.define(
25
25
  function(
26
26
  ControllerExtension,
27
27
  OverrideExecution,
28
- sticky,
29
28
  Log,
30
29
  Text,
31
30
  Button,
@@ -49,7 +48,6 @@ sap.ui.define(
49
48
  * @name sap.fe.core.controllerextensions.EditFlow
50
49
  * @hideconstructor
51
50
  * @public
52
- * @experimental As of version 1.90.0
53
51
  * @since 1.90.0
54
52
  */
55
53
 
@@ -59,7 +57,7 @@ sap.ui.define(
59
57
  DraftStatus = FELibrary.DraftStatus,
60
58
  EditMode = FELibrary.EditMode;
61
59
 
62
- var Extension = ControllerExtension.extend("sap.fe.core.controllerextensions.EditFlow", {
60
+ return ControllerExtension.extend("sap.fe.core.controllerextensions.EditFlow", {
63
61
  metadata: {
64
62
  methods: {
65
63
  editDocument: { "public": true, "final": true },
@@ -73,7 +71,11 @@ sap.ui.define(
73
71
  invokeAction: { "public": true, "final": true },
74
72
  securedExecution: { "public": true, "final": true },
75
73
 
76
- onBeforeSave: { "public": true, "final": false, "overrideExecution": OverrideExecution.Instead }
74
+ onBeforeSave: { "public": true, "final": false, "overrideExecution": OverrideExecution.After },
75
+ onBeforeDelete: { "public": true, "final": false, "overrideExecution": OverrideExecution.After },
76
+ onBeforeCreate: { "public": true, "final": false, "overrideExecution": OverrideExecution.After },
77
+ onBeforeEdit: { "public": true, "final": false, "overrideExecution": OverrideExecution.After },
78
+ onBeforeDiscard: { "public": true, "final": false, "overrideExecution": OverrideExecution.After }
77
79
  }
78
80
  },
79
81
 
@@ -90,10 +92,11 @@ sap.ui.define(
90
92
  *
91
93
  * @memberof sap.fe.core.controllerextensions.EditFlow
92
94
  * @param {object} oContext Context of the active document
95
+ * @param {map} [mParameters] Contains the following attributes:
96
+ * @param {boolean} [mParameters.prepareOnEdit] For a service with a prepare action, this parameter decides if the action is to be executed
93
97
  * @returns {Promise} Promise resolves once the editable document is available
94
98
  * @alias sap.fe.core.controllerextensions.EditFlow#editDocument
95
99
  * @public
96
- * @experimental As of version 1.90.0
97
100
  * @since 1.90.0
98
101
  */
99
102
  editDocument: function(oContext, mParameters) {
@@ -103,8 +106,17 @@ sap.ui.define(
103
106
  bDraftNavigation = true,
104
107
  transactionHelper = this._getTransactionHelper();
105
108
 
106
- return transactionHelper
107
- .editDocument(oContext, bPrepareOnEdit, that.getView(), that._getMessageHandler())
109
+ return this.base.editFlow
110
+ .onBeforeEdit({ context: oContext })
111
+ .then(
112
+ transactionHelper.editDocument.bind(
113
+ transactionHelper,
114
+ oContext,
115
+ bPrepareOnEdit,
116
+ that.getView(),
117
+ that._getMessageHandler()
118
+ )
119
+ )
108
120
  .then(function(oNewDocumentContext) {
109
121
  var sProgrammingModel = that._getProgrammingModel(oContext);
110
122
 
@@ -127,10 +139,20 @@ sap.ui.define(
127
139
  });
128
140
  }
129
141
  }
142
+ })
143
+ .catch(function(oError) {
144
+ Log.error("Error while editing the document", oError);
130
145
  });
131
146
  },
132
147
 
133
148
  deleteMultipleDocuments: function(aContexts, mParameters) {
149
+ if (mParameters) {
150
+ mParameters.beforeDeleteCallBack = this.base.editFlow.onBeforeDelete;
151
+ } else {
152
+ mParameters = {
153
+ beforeDeleteCallBack: this.base.editFlow.onBeforeDelete
154
+ };
155
+ }
134
156
  return this.base
135
157
  .getView()
136
158
  .getController()
@@ -146,30 +168,31 @@ sap.ui.define(
146
168
  * @returns {Promise} Promise resolves once draft status has been updated
147
169
  * @alias sap.fe.core.controllerextensions.EditFlow#updateDocument
148
170
  * @public
149
- * @experimental As of version 1.90.0
150
171
  * @since 1.90.0
151
172
  */
152
173
  updateDocument: function(oContext, oPromise) {
153
174
  var that = this,
154
175
  transactionHelper = that._getTransactionHelper(),
176
+ oBindingContext = that.getView().getBindingContext(),
155
177
  bIsDraft = that._getProgrammingModel(oContext) === ProgrammingModel.Draft;
156
178
 
157
179
  this._getMessageHandler().removeTransitionMessages();
158
180
  return this._syncTask(function() {
159
- transactionHelper.handleDocumentModifications();
160
- EditState.setEditStateDirty();
161
- that._getMessageHandler().removeTransitionMessages();
181
+ if (oBindingContext) {
182
+ transactionHelper.handleDocumentModifications();
183
+ EditState.setEditStateDirty();
162
184
 
163
- if (bIsDraft) {
164
- that._setDraftStatus(DraftStatus.Saving);
185
+ if (bIsDraft) {
186
+ that._setDraftStatus(DraftStatus.Saving);
187
+ }
165
188
  }
189
+ that._getMessageHandler().removeTransitionMessages();
166
190
 
167
191
  return oPromise
168
192
  .then(
169
193
  function() {
170
- if (bIsDraft) {
171
- var oBindingContext = that.getView().getBindingContext(),
172
- oMetaModel = oBindingContext.getModel().getMetaModel(),
194
+ if (bIsDraft && oBindingContext) {
195
+ var oMetaModel = oBindingContext.getModel().getMetaModel(),
173
196
  sEntitySetName = oMetaModel.getMetaContext(oBindingContext.getPath()).getObject("@sapui.name"),
174
197
  aSemanticKeys = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
175
198
  if (aSemanticKeys && aSemanticKeys.length) {
@@ -193,7 +216,7 @@ sap.ui.define(
193
216
  }
194
217
  },
195
218
  function() {
196
- if (bIsDraft) {
219
+ if (bIsDraft && oBindingContext) {
197
220
  that._setDraftStatus(DraftStatus.Clear);
198
221
  }
199
222
  }
@@ -209,11 +232,9 @@ sap.ui.define(
209
232
 
210
233
  // Internal only params ---
211
234
  // * @param {string} mParameters.creationMode The creation mode using one of the following:
212
- // * NewPage - the created document is shown in a new page, depending on whether metadata Sync, Async or Deferred is used
213
235
  // * Sync - the creation is triggered and once the document is created, the navigation is done
214
236
  // * Async - the creation and the navigation to the instance are done in parallel
215
237
  // * Deferred - the creation is done on the target page
216
- // * Inline - The creation is done inline (in a table)
217
238
  // * CreationRow - The creation is done inline async so the user is not blocked
218
239
  // mParameters.creationRow Instance of the creation row - (TODO: get rid but use list bindings only)
219
240
 
@@ -223,10 +244,16 @@ sap.ui.define(
223
244
  *
224
245
  * @memberof sap.fe.core.controllerextensions.EditFlow
225
246
  * @param {sap.ui.model.odata.v4.ODataListBinding|string} vListBinding ODataListBinding object or the binding path for a temporary list binding
247
+ * @param {map} mParameters Contains the following attributes:
248
+ * @param {string} mParameters.creationMode The creation mode using one of the following:
249
+ * NewPage - the created document is shown in a new page, depending on whether metadata 'Sync', 'Async' or 'Deferred' is used
250
+ * Inline - The creation is done inline (in a table)
251
+ * External - The creation is done in a different application specified via the parameter 'outbound'
252
+ * @param {string} [mParameters.outbound] The navigation target where the document is created in case of creationMode 'External'
253
+ * @param {boolean} [mParameters.createAtEnd] Specifies if the new entry should be created at the top or bottom of a table in case of creationMode 'Inline'
226
254
  * @returns {Promise} Promise resolves once the object has been created
227
255
  * @alias sap.fe.core.controllerextensions.EditFlow#createDocument
228
256
  * @public
229
- * @experimental As of version 1.90.0
230
257
  * @since 1.90.0
231
258
  */
232
259
  createDocument: function(vListBinding, mParameters) {
@@ -241,7 +268,7 @@ sap.ui.define(
241
268
  (mParameters.creationMode !== CreationMode.Inline &&
242
269
  mParameters.creationMode !== CreationMode.CreationRow &&
243
270
  mParameters.creationMode !== CreationMode.External),
244
- oExecFunctionFromManifestPromise = Promise.resolve([]),
271
+ oExecCustomValidation = Promise.resolve([]),
245
272
  oAppComponent = CommonUtils.getAppComponent(this.getView());
246
273
  oAppComponent.getRouterProxy().removeIAppStateKey();
247
274
 
@@ -257,27 +284,17 @@ sap.ui.define(
257
284
  }
258
285
 
259
286
  if (mParameters.creationMode === CreationMode.CreationRow && mParameters.creationRow) {
287
+ var oCreationRowObjects = mParameters.creationRow.getBindingContext().getObject();
288
+ delete oCreationRowObjects["@$ui5.context.isTransient"];
260
289
  oTable = mParameters.creationRow.getParent();
261
- // get custom validation function from manifest
262
- var sCustomValidationFunction = oTable.getCreationRow().data("customValidationFunction");
263
- if (sCustomValidationFunction) {
264
- var sModule = sCustomValidationFunction
265
- .substring(0, sCustomValidationFunction.lastIndexOf(".") || -1)
266
- .replace(/\./gi, "/"),
267
- sFunctionName = sCustomValidationFunction.substring(
268
- sCustomValidationFunction.lastIndexOf(".") + 1,
269
- sCustomValidationFunction.length
270
- ),
271
- oCreationRowObjects = mParameters.creationRow.getBindingContext().getObject();
272
- delete oCreationRowObjects["@$ui5.context.isTransient"];
273
- oExecFunctionFromManifestPromise = FPMHelper.validationWrapper(
274
- sModule,
275
- sFunctionName,
276
- oCreationRowObjects,
277
- that.base.getView(),
278
- oTable.getBindingContext("internal")
279
- );
280
- }
290
+ oExecCustomValidation = transactionHelper.validateDocument(
291
+ oTable.getBindingContext(),
292
+ {
293
+ data: oCreationRowObjects,
294
+ customValidationFunction: oTable.getCreationRow().data("customValidationFunction")
295
+ },
296
+ that.base.getView()
297
+ );
281
298
 
282
299
  // disableAddRowButtonForEmptyData is set to false in manifest converter (Table.ts) if customValidationFunction exists
283
300
  if (oTable.getCreationRow().data("disableAddRowButtonForEmptyData") === "true") {
@@ -392,7 +409,7 @@ sap.ui.define(
392
409
  }
393
410
 
394
411
  bShouldBusyLock && BusyLocker.lock(oLockObject);
395
- return this._syncTask(oExecFunctionFromManifestPromise)
412
+ return this._syncTask(oExecCustomValidation)
396
413
  .then(function(aValidationMessages) {
397
414
  if (aValidationMessages.length > 0) {
398
415
  createCustomValidationMessages(aValidationMessages);
@@ -448,7 +465,11 @@ sap.ui.define(
448
465
  }
449
466
  }
450
467
  var sMetaPath = oMetaModel.getMetaPath(oListBinding.getHeaderContext().getPath());
451
- var aNonComputedVisibleKeyFields = CommonUtils.getNonComputedVisibleFields(oMetaModel, sMetaPath);
468
+ var aNonComputedVisibleKeyFields = CommonUtils.getNonComputedVisibleFields(
469
+ oMetaModel,
470
+ sMetaPath,
471
+ that.getView()
472
+ );
452
473
  if (aNonComputedVisibleKeyFields.length > 0) {
453
474
  return CreationMode.Deferred;
454
475
  }
@@ -497,11 +518,14 @@ sap.ui.define(
497
518
  if (!mParameters.parentControl) {
498
519
  mParameters.parentControl = that.getView();
499
520
  }
521
+ mParameters.beforeCreateCallBack = that.base.editFlow.onBeforeCreate;
500
522
  return transactionHelper.createDocument(
501
523
  oListBinding,
502
524
  mParameters,
503
525
  oResourceBundle,
504
- that._getMessageHandler()
526
+ that._getMessageHandler(),
527
+ false,
528
+ that.getView()
505
529
  );
506
530
  });
507
531
  }
@@ -546,7 +570,7 @@ sap.ui.define(
546
570
  });
547
571
  break;
548
572
  case CreationMode.Inline:
549
- oNavigation = handleSideEffects(oListBinding, oCreation);
573
+ handleSideEffects(oListBinding, oCreation);
550
574
  that._syncTask(oCreation);
551
575
  break;
552
576
  case CreationMode.CreationRow:
@@ -642,21 +666,103 @@ sap.ui.define(
642
666
  },
643
667
 
644
668
  /**
645
- * This function can be used to intercept the save action. You can execute custom coding in this function.
646
- * The framework waits for the returned promise to be resolved before continuing the save action. If you
647
- * reject the promise the save action is stopped and the user stays in edit mode.
669
+ * This function can be used to intercept the 'Save' action. You can execute custom coding in this function.
670
+ * The framework waits for the returned promise to be resolved before continuing the 'Save' action.
671
+ * If you reject the promise, the 'Save' action is stopped and the user stays in edit mode.
648
672
  *
649
673
  * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
650
- * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.Instead}.
651
- *
652
- * @returns {Promise} A promise to be returned by the overridden method. If resolved, the save action is triggered. If rejected, the save action is not triggered and the user stays in edit mode.
674
+ * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
675
+ * @param {map} [mParameters] Object containing the parameters passed to onBeforeSave
676
+ * @param {sap.ui.model.odata.v4.Context} [mParameters.context] Page context that is going to be saved.
677
+ * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Save' action is triggered. If rejected, the 'Save' action is not triggered and the user stays in edit mode.
653
678
  * @memberof sap.fe.core.controllerextensions.EditFlow
654
679
  * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeSave
655
680
  * @public
656
681
  * @experimental As of version 1.90.0
657
682
  * @since 1.90.0
658
683
  */
659
- onBeforeSave: function() {
684
+ onBeforeSave: function(mParameters) {
685
+ // to be overridden
686
+ return Promise.resolve();
687
+ },
688
+ /**
689
+ * This function can be used to intercept the 'Create' action. You can execute custom coding in this function.
690
+ * The framework waits for the returned promise to be resolved before continuing the 'Create' action.
691
+ * If you reject the promise, the 'Create' action is stopped.
692
+ *
693
+ * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
694
+ * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
695
+ * @param {map} [mParameters] Object containing the parameters passed to onBeforeCreate
696
+ * @param {string} [mParameters.contextPath] Path pointing to the context on which Create action is triggered
697
+ * @param {Array} [mParameters.createParameters] Array of values that are filled in the Action Parameter Dialog
698
+ * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Create' action is triggered. If rejected, the 'Create' action is not triggered.
699
+ * @memberof sap.fe.core.controllerextensions.EditFlow
700
+ * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeCreate
701
+ * @public
702
+ * @experimental As of version 1.98.0
703
+ * @since 1.98.0
704
+ */
705
+ onBeforeCreate: function(mParameters) {
706
+ // to be overridden
707
+ return Promise.resolve();
708
+ },
709
+ /**
710
+ * This function can be used to intercept the 'Edit' action. You can execute custom coding in this function.
711
+ * The framework waits for the returned promise to be resolved before continuing the 'Edit' action.
712
+ * If you reject the promise, the 'Edit' action is stopped and the user stays in display mode.
713
+ *
714
+ * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
715
+ * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
716
+ * @param {map} [mParameters] Object containing the parameters passed to onBeforeEdit
717
+ * @param {sap.ui.model.odata.v4.Context} [mParameters.context] Page context that is going to be edited.
718
+ * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Edit' action is triggered. If rejected, the 'Edit' action is not triggered and the user stays in display mode.
719
+ * @memberof sap.fe.core.controllerextensions.EditFlow
720
+ * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeEdit
721
+ * @public
722
+ * @experimental As of version 1.98.0
723
+ * @since 1.98.0
724
+ */
725
+ onBeforeEdit: function(mParameters) {
726
+ // to be overridden
727
+ return Promise.resolve();
728
+ },
729
+ /**
730
+ * This function can be used to intercept the 'Discard' action. You can execute custom coding in this function.
731
+ * The framework waits for the returned promise to be resolved before continuing the 'Discard' action.
732
+ * If you reject the promise, the 'Discard' action is stopped and the user stays in edit mode.
733
+ *
734
+ * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
735
+ * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
736
+ * @param {map} [mParameters] Object containing the parameters passed to onBeforeDiscard
737
+ * @param {sap.ui.model.odata.v4.Context} [mParameters.context] Page context that is going to be discarded.
738
+ * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Discard' action is triggered. If rejected, the 'Discard' action is not triggered and the user stays in edit mode.
739
+ * @memberof sap.fe.core.controllerextensions.EditFlow
740
+ * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDiscard
741
+ * @public
742
+ * @experimental As of version 1.98.0
743
+ * @since 1.98.0
744
+ */
745
+ onBeforeDiscard: function(mParameters) {
746
+ // to be overridden
747
+ return Promise.resolve();
748
+ },
749
+ /**
750
+ * This function can be used to intercept the 'Delete' action. You can execute custom coding in this function.
751
+ * The framework waits for the returned promise to be resolved before continuing the 'Delete' action.
752
+ * If you reject the promise, the 'Delete' action is stopped.
753
+ *
754
+ * This function is meant to be individually overridden by consuming controllers, but not to be called directly.
755
+ * The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
756
+ * @param {map} [mParameters] Object containing the parameters passed to onBeforeDelete
757
+ * @param {Array} [mParameters.contexts] An array of contexts that are going to be deleted
758
+ * @returns {Promise} A promise to be returned by the overridden method. If resolved, the 'Delete' action is triggered. If rejected, the 'Delete' action is not triggered.
759
+ * @memberof sap.fe.core.controllerextensions.EditFlow
760
+ * @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDelete
761
+ * @public
762
+ * @experimental As of version 1.98.0
763
+ * @since 1.98.0
764
+ */
765
+ onBeforeDelete: function(mParameters) {
660
766
  // to be overridden
661
767
  return Promise.resolve();
662
768
  },
@@ -676,7 +782,6 @@ sap.ui.define(
676
782
  * @returns {Promise} Promise resolves once save is complete
677
783
  * @alias sap.fe.core.controllerextensions.EditFlow#saveDocument
678
784
  * @public
679
- * @experimental As of version 1.90.0
680
785
  * @since 1.90.0
681
786
  */
682
787
  saveDocument: function(oContext, mParameters) {
@@ -694,7 +799,7 @@ sap.ui.define(
694
799
  .then(this._submitOpenChanges.bind(this, oContext))
695
800
  // check if there are any validation/parse errors
696
801
  .then(this._checkForValidationErrors.bind(this, oContext))
697
- .then(this.base.editFlow.onBeforeSave.bind(this))
802
+ .then(this.base.editFlow.onBeforeSave.bind(this, { context: oContext }))
698
803
  // and finally if all user changes are submitted and valid save the document
699
804
  .then(
700
805
  transactionHelper.saveDocument.bind(
@@ -785,12 +890,12 @@ sap.ui.define(
785
890
  *
786
891
  * @memberof sap.fe.core.controllerextensions.EditFlow
787
892
  * @param {object} oContext Context of the editable document
788
- * @param {map} [mParameters] Can contain the following attributes:
789
- * @param {object} mParameters.control This is the control used to open the Discard popover. It is mandatory.
893
+ * @param {map} mParameters Can contain the following attributes:
894
+ * @param {object} mParameters.control This is the control used to open the discard popover
895
+ * @param {boolean} [mParameters.skipDiscardPopover] Optional, supresses the discard popover and allows custom handling
790
896
  * @returns {Promise} Promise resolves once editable document has been discarded
791
897
  * @alias sap.fe.core.controllerextensions.EditFlow#cancelDocument
792
898
  * @public
793
- * @experimental As of version 1.90.0
794
899
  * @since 1.90.0
795
900
  */
796
901
  cancelDocument: function(oContext, mParameters) {
@@ -798,6 +903,7 @@ sap.ui.define(
798
903
  transactionHelper = this._getTransactionHelper(),
799
904
  oResourceBundle = that.getView().getController().oResourceBundle;
800
905
  mParameters.cancelButton = mParameters.control || mParameters.cancelButton;
906
+ mParameters.beforeCancelCallBack = this.base.editFlow.onBeforeDiscard;
801
907
  return this._syncTask()
802
908
  .then(
803
909
  transactionHelper.cancelDocument.bind(
@@ -824,7 +930,9 @@ sap.ui.define(
824
930
  //in case of a new document, the value of hasActiveEntity is returned. navigate back.
825
931
  if (!oActiveDocumentContext) {
826
932
  EditState.setEditStateDirty();
827
- that._getRoutingListener().navigateBackFromContext(oContext);
933
+ return mParameters.skipBackNavigation
934
+ ? undefined
935
+ : that._getRoutingListener().navigateBackFromContext(oContext);
828
936
  } else if (sProgrammingModel === ProgrammingModel.Draft) {
829
937
  // We need to load the semantic keys of the active context, as we need them
830
938
  // for the navigation
@@ -832,7 +940,7 @@ sap.ui.define(
832
940
  // We force the recreation of the context, so that it's created and bound in the same microtask,
833
941
  // so that all properties are loaded together by autoExpandSelect, so that when switching back to Edit mode
834
942
  // $$inheritExpandSelect takes all loaded properties into account (BCP 2070462265)
835
- if (mParameters.bSkipBindingToView) {
943
+ if (mParameters.skipBindingToView) {
836
944
  return oActiveDocumentContext;
837
945
  } else {
838
946
  return that._handleNewContext(oActiveDocumentContext, false, true, bDraftNavigation, true);
@@ -842,6 +950,9 @@ sap.ui.define(
842
950
  //active context is returned in case of cancel of existing document
843
951
  return that._handleNewContext(oActiveDocumentContext, false, undefined, bDraftNavigation, true);
844
952
  }
953
+ })
954
+ .catch(function(oError) {
955
+ Log.error("Error while discarding the document", oError);
845
956
  });
846
957
  },
847
958
 
@@ -853,13 +964,12 @@ sap.ui.define(
853
964
  *
854
965
  * @memberof sap.fe.core.controllerextensions.EditFlow
855
966
  * @param {object} oContext Context of the document
856
- * @param {map} [mParameters] Optional, can contain the following attributes:
967
+ * @param {map} mParameters Can contain the following attributes:
857
968
  * @param {string} mParameters.title Title of the object being deleted
858
969
  * @param {string} mParameters.description Description of the object being deleted
859
970
  * @returns {Promise} Promise resolves once document has been deleted
860
971
  * @alias sap.fe.core.controllerextensions.EditFlow#deleteDocument
861
972
  * @public
862
- * @experimental As of version 1.90.0
863
973
  * @since 1.90.0
864
974
  */
865
975
  deleteDocument: function(oContext, mParameters) {
@@ -872,17 +982,22 @@ sap.ui.define(
872
982
  } else {
873
983
  mParameters.bFindActiveContexts = false;
874
984
  }
875
- return this._deleteDocumentTransaction(oContext, mParameters).then(function() {
876
- // Single objet deletion is triggered from an OP header button (not from a list)
877
- // --> Mark UI dirty and navigate back to dismiss the OP
878
- EditState.setEditStateDirty();
879
-
880
- that._getRoutingListener().navigateBackFromContext(oContext);
881
- // After delete is successfull, we need to dettch the setBackNavigation Methods
882
- if (oAppComponent) {
883
- oAppComponent.getShellServices().setBackNavigation();
884
- }
885
- });
985
+ mParameters.beforeDeleteCallBack = this.base.editFlow.onBeforeDelete;
986
+ return this._deleteDocumentTransaction(oContext, mParameters)
987
+ .then(function() {
988
+ // Single objet deletion is triggered from an OP header button (not from a list)
989
+ // --> Mark UI dirty and navigate back to dismiss the OP
990
+ EditState.setEditStateDirty();
991
+
992
+ that._getRoutingListener().navigateBackFromContext(oContext);
993
+ // After delete is successfull, we need to dettch the setBackNavigation Methods
994
+ if (oAppComponent) {
995
+ oAppComponent.getShellServices().setBackNavigation();
996
+ }
997
+ })
998
+ .catch(function(oError) {
999
+ Log.error("Error while deleting the document", oError);
1000
+ });
886
1001
  },
887
1002
 
888
1003
  /**
@@ -893,7 +1008,6 @@ sap.ui.define(
893
1008
  * @returns {Promise} Promise resolves once the changes have been saved
894
1009
  * @alias sap.fe.core.controllerextensions.EditFlow#applyDocument
895
1010
  * @public
896
- * @experimental As of version 1.90.0
897
1011
  * @since 1.90.0
898
1012
  */
899
1013
  applyDocument: function(oContext) {
@@ -928,22 +1042,22 @@ sap.ui.define(
928
1042
  * @memberof sap.fe.core.controllerextensions.EditFlow
929
1043
  * @param {string} sActionName The name of the action to be called
930
1044
  * @param {map} [mParameters] Contains the following attributes:
931
- * @param {sap.ui.model.odata.v4.Context} [mParameters.contexts] For a bound action, a context or an array with contexts for which the action shall be called must be provided
1045
+ * @param {sap.ui.model.odata.v4.Context} [mParameters.contexts] For a bound action, a context or an array with contexts for which the action is to be called must be provided
932
1046
  * @param {sap.ui.model.odata.v4.ODataModel} [mParameters.model] For an unbound action, an instance of an OData V4 model must be provided
933
- * @param {boolean} [mParameters.requiresNavigation] Boolean value indicating whether navigation is required after the action has been executed. Navigation takes place to the context returned by the action.
934
- * @param {string} [mParameters.label] A human-readable label for the action. This is needed in case the action has a parameter and a parameter dialog is shown to the user.
1047
+ * @param {boolean} [mParameters.requiresNavigation] Boolean value indicating whether navigation is required after the action has been executed. Navigation takes place to the context returned by the action
1048
+ * @param {string} [mParameters.label] A human-readable label for the action. This is needed in case the action has a parameter and a parameter dialog is shown to the user. The label will be used for the title of the dialog and for the confirmation button
1049
+ * @param {string} [mParameters.invocationGrouping] Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
935
1050
  * @returns {Promise}
936
1051
  * @alias sap.fe.core.controllerextensions.EditFlow#invokeAction
937
1052
  * @public
938
- * @experimental As of version 1.90.0
939
1053
  * @since 1.90.0
940
1054
  * @final
941
1055
  **/
942
1056
  invokeAction: function(sActionName, mParameters) {
943
1057
  var that = this,
944
- oTable,
945
- transactionHelper = this._getTransactionHelper(),
946
1058
  oControl,
1059
+ transactionHelper = this._getTransactionHelper(),
1060
+ oCurrentControl,
947
1061
  oBindingContext,
948
1062
  aParts,
949
1063
  sOverloadEntityType,
@@ -975,11 +1089,11 @@ sap.ui.define(
975
1089
  mParameters.parentControl = this.getView();
976
1090
  }
977
1091
 
978
- if (mParameters.prefix) {
979
- oTable = this.getView().byId(mParameters.prefix);
980
- if (oTable) {
1092
+ if (mParameters.controlId) {
1093
+ oControl = this.getView().byId(mParameters.controlId);
1094
+ if (oControl) {
981
1095
  // TODO: currently this selected contexts update is done within the operation, should be moved out
982
- mParameters.internalModelContext = oTable.getBindingContext("internal");
1096
+ mParameters.internalModelContext = oControl.getBindingContext("internal");
983
1097
  }
984
1098
  } else {
985
1099
  mParameters.internalModelContext = oView.getBindingContext("internal");
@@ -996,10 +1110,10 @@ sap.ui.define(
996
1110
  }
997
1111
 
998
1112
  if (mParameters.bStaticAction) {
999
- if (oTable.isTableBound()) {
1000
- mParameters.contexts = oTable.getRowBinding().getHeaderContext();
1113
+ if (oControl.isTableBound()) {
1114
+ mParameters.contexts = oControl.getRowBinding().getHeaderContext();
1001
1115
  } else {
1002
- var sBindingPath = oTable.data("rowsBindingInfo").path,
1116
+ var sBindingPath = oControl.data("rowsBindingInfo").path,
1003
1117
  oListBinding = new ODataListBinding(that.getView().getModel(), sBindingPath);
1004
1118
  mParameters.contexts = oListBinding.getHeaderContext();
1005
1119
  }
@@ -1012,9 +1126,9 @@ sap.ui.define(
1012
1126
  .getObject("$Type");
1013
1127
  if (sOverloadEntityType !== sTableContextEntityType) {
1014
1128
  // search for context in control tree hierarchy
1015
- oControl = oTable;
1016
- while (oControl) {
1017
- oBindingContext = oControl.getBindingContext();
1129
+ oCurrentControl = oControl;
1130
+ while (oCurrentControl) {
1131
+ oBindingContext = oCurrentControl.getBindingContext();
1018
1132
  if (
1019
1133
  oBindingContext &&
1020
1134
  oBindingContext
@@ -1027,7 +1141,7 @@ sap.ui.define(
1027
1141
  break;
1028
1142
  } else {
1029
1143
  // check parent
1030
- oControl = oControl.getParent();
1144
+ oCurrentControl = oCurrentControl.getParent();
1031
1145
  }
1032
1146
  }
1033
1147
  if (!mParameters.contexts) {
@@ -1037,7 +1151,7 @@ sap.ui.define(
1037
1151
  }
1038
1152
 
1039
1153
  if (mParameters.enableAutoScroll) {
1040
- oCurrentActionCallBacks = this._createActionPromise(sActionName, oTable.sId);
1154
+ oCurrentActionCallBacks = this._createActionPromise(sActionName, oControl.sId);
1041
1155
  }
1042
1156
  }
1043
1157
 
@@ -1087,6 +1201,7 @@ sap.ui.define(
1087
1201
  */
1088
1202
  if (mParameters.contexts) {
1089
1203
  EditState.setEditStateDirty();
1204
+ that._getInternalModel().setProperty("/sCustomAction", sActionName);
1090
1205
  }
1091
1206
  if (mParameters.isNavigable) {
1092
1207
  var vContext = oResponse;
@@ -1372,140 +1487,31 @@ sap.ui.define(
1372
1487
  },
1373
1488
 
1374
1489
  _handleStickyOn: function(oContext) {
1375
- var that = this,
1376
- oAppComponent = CommonUtils.getAppComponent(this.getView());
1377
-
1378
- if (!oAppComponent.getRouterProxy().hasNavigationGuard()) {
1379
- var sHashTracker = oAppComponent.getRouterProxy().getHash(),
1380
- oInternalModel = this._getInternalModel();
1381
-
1382
- // Set a guard in the RouterProxy
1383
- // A timeout is necessary, as with deferred creation the hashChanger is not updated yet with
1384
- // the new hash, and the guard cannot be found in the managed history of the router proxy
1385
- setTimeout(function() {
1386
- oAppComponent.getRouterProxy().setNavigationGuard();
1387
- }, 0);
1388
-
1389
- // Setting back navigation on shell service, to get the dicard message box in case of sticky
1390
- oAppComponent.getShellServices().setBackNavigation(that._onBackNavigationInSession.bind(that));
1391
-
1392
- this.fnDirtyStateProvider = function(oNavigationContext) {
1393
- var sTargetHash = oNavigationContext.innerAppRoute,
1394
- oRouterProxy = oAppComponent.getRouterProxy(),
1395
- bDirty,
1396
- bSessionON = oInternalModel.getProperty("/sessionOn");
1397
-
1398
- if (!bSessionON) {
1399
- // If the sticky session was terminated before hand.
1400
- // Eexample in case of navigating away from application using IBN.
1401
- return;
1402
- }
1403
-
1404
- if (!oRouterProxy.isNavigationFinalized()) {
1405
- // If navigation is currently happening in RouterProxy, it's a transient state
1406
- // (not dirty)
1407
- bDirty = false;
1408
- sHashTracker = sTargetHash;
1409
- } else if (sHashTracker === sTargetHash) {
1410
- // the hash didn't change so either the user attempts to refresh or to leave the app
1411
- bDirty = true;
1412
- } else if (oRouterProxy.checkHashWithGuard(sTargetHash) || oRouterProxy.isGuardCrossAllowedByUser()) {
1413
- // the user attempts to navigate within the root object
1414
- // or crossing the guard has already been allowed by the RouterProxy
1415
- sHashTracker = sTargetHash;
1416
- bDirty = false;
1417
- } else {
1418
- // the user attempts to navigate within the app, for example back to the list report
1419
- bDirty = true;
1420
- }
1421
-
1422
- if (bDirty) {
1423
- // the FLP doesn't call the dirty state provider anymore once it's dirty, as they can't
1424
- // change this due to compatibility reasons we set it back to not-dirty
1425
- setTimeout(function() {
1426
- oAppComponent.getShellServices().setDirtyFlag(false);
1427
- }, 0);
1428
- }
1429
-
1430
- return bDirty;
1431
- };
1432
-
1433
- oAppComponent.getShellServices().registerDirtyStateProvider(this.fnDirtyStateProvider);
1434
-
1435
- var i18nModel = this.getView().getModel("sap.fe.i18n");
1436
-
1437
- this.fnHandleSessionTimeout = function() {
1438
- // remove transient messages since we will showing our own message
1439
- that._getMessageHandler().removeTransitionMessages();
1440
-
1441
- var oDialog = new Dialog({
1442
- title: "{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_TITLE}",
1443
- state: "Warning",
1444
- content: new Text({ text: "{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_MESSAGE}" }),
1445
- beginButton: new Button({
1446
- text: "{sap.fe.i18n>C_COMMON_DIALOG_OK}",
1447
- type: "Emphasized",
1448
- press: function() {
1449
- // remove sticky handling after navigation since session has already been terminated
1450
- that._handleStickyOff();
1451
- that._getRoutingListener().navigateBackFromContext(oContext);
1452
- }
1453
- }),
1454
- afterClose: function() {
1455
- oDialog.destroy();
1456
- }
1457
- });
1458
- oDialog.addStyleClass("sapUiContentPadding");
1459
- oDialog.setModel(i18nModel, "sap.fe.i18n");
1460
- that.getView().addDependent(oDialog);
1461
- oDialog.open();
1462
- };
1463
- // handle session timeout
1464
- this.getView()
1465
- .getModel()
1466
- .attachSessionTimeout(this.fnHandleSessionTimeout);
1467
-
1468
- this._fnStickyDiscardAfterNavigation = function() {
1469
- var sCurrentHash = oAppComponent.getRouterProxy().getHash();
1470
- // either current hash is empty so the user left the app or he navigated away from the object
1471
- if (!sCurrentHash || !oAppComponent.getRouterProxy().checkHashWithGuard(sCurrentHash)) {
1472
- that._discardStickySession(oContext);
1473
- }
1474
- };
1475
- oAppComponent.getRoutingService().attachRouteMatched(this._fnStickyDiscardAfterNavigation);
1476
- }
1490
+ return this.base
1491
+ .getView()
1492
+ .getController()
1493
+ ._editFlow.handleStickyOn(oContext);
1477
1494
  },
1478
1495
 
1479
1496
  _handleStickyOff: function() {
1480
- var oAppComponent = CommonUtils.getAppComponent(this.getView());
1481
-
1482
- if (oAppComponent.getRouterProxy) {
1483
- // If we have exited from the app, CommonUtils.getAppComponent doesn't return a
1484
- // sap.fe.core.AppComponent, hence the 'if' above
1485
- oAppComponent.getRouterProxy().discardNavigationGuard();
1486
- }
1487
-
1488
- if (this.fnDirtyStateProvider) {
1489
- oAppComponent.getShellServices().deregisterDirtyStateProvider(this.fnDirtyStateProvider);
1490
- this.fnDirtyStateProvider = null;
1491
- }
1492
-
1493
- if (this.getView().getModel() && this.fnHandleSessionTimeout) {
1494
- this.getView()
1495
- .getModel()
1496
- .detachSessionTimeout(this.fnHandleSessionTimeout);
1497
- }
1498
-
1499
- oAppComponent.getRoutingService().detachRouteMatched(this._fnStickyDiscardAfterNavigation);
1500
- this._fnStickyDiscardAfterNavigation = null;
1497
+ return this.base
1498
+ .getView()
1499
+ .getController()
1500
+ ._editFlow.handleStickyOff();
1501
+ },
1501
1502
 
1502
- this._setEditMode(EditMode.Display, false);
1503
+ _onBackNavigationInSession: function() {
1504
+ return this.base
1505
+ .getView()
1506
+ .getController()
1507
+ ._editFlow.onBackNavigationInSession();
1508
+ },
1503
1509
 
1504
- if (oAppComponent) {
1505
- // If we have exited from the app, CommonUtils.getAppComponent doesn't return a
1506
- // sap.fe.core.AppComponent, hence the 'if' above
1507
- oAppComponent.getShellServices().setBackNavigation();
1508
- }
1510
+ _discardStickySession: function(oContext) {
1511
+ return this.base
1512
+ .getView()
1513
+ .getController()
1514
+ ._editFlow.discardStickySession(oContext);
1509
1515
  },
1510
1516
 
1511
1517
  _handleNewContext: function(oContext, bEditable, bRecreateContext, bDraftNavigation, bForceFocus) {
@@ -1563,41 +1569,6 @@ sap.ui.define(
1563
1569
  });
1564
1570
  },
1565
1571
 
1566
- /**
1567
- * @description Method to display a 'discard' popover when exiting a sticky session.
1568
- *
1569
- * @function
1570
- * @name _onBackNavigationInSession
1571
- * @memberof sap.fe.core.controllerextensions.EditFlow
1572
- */
1573
- _onBackNavigationInSession: function() {
1574
- var that = this,
1575
- oView = that.getView(),
1576
- oAppComponent = CommonUtils.getAppComponent(oView),
1577
- oRouterProxy = oAppComponent.getRouterProxy();
1578
-
1579
- if (oRouterProxy.checkIfBackIsOutOfGuard()) {
1580
- var oBindingContext = oView && oView.getBindingContext();
1581
-
1582
- CommonUtils.processDataLossConfirmation(
1583
- function() {
1584
- that._discardStickySession(oBindingContext);
1585
- history.back();
1586
- },
1587
- oView,
1588
- that._getProgrammingModel(oBindingContext)
1589
- );
1590
-
1591
- return;
1592
- }
1593
- history.back();
1594
- },
1595
-
1596
- _discardStickySession: function(oContext) {
1597
- sticky.discardDocument(oContext);
1598
- this._handleStickyOff();
1599
- },
1600
-
1601
1572
  /**
1602
1573
  * @function
1603
1574
  * @name _refreshListIfRequired
@@ -1697,7 +1668,5 @@ sap.ui.define(
1697
1668
  });
1698
1669
  }
1699
1670
  });
1700
-
1701
- return Extension;
1702
1671
  }
1703
1672
  );