@openui5/sap.ui.core 1.110.0 → 1.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/.eslintrc.json +1 -0
  2. package/package.json +1 -1
  3. package/src/jquery.sap.global.js +1 -1
  4. package/src/jquery.sap.properties.js +1 -1
  5. package/src/jquery.sap.resources.js +1 -1
  6. package/src/jquery.sap.script.js +1 -1
  7. package/src/jquery.sap.storage.js +3 -3
  8. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  9. package/src/sap/base/util/restricted/_castArray.js +1 -1
  10. package/src/sap/base/util/restricted/_compact.js +1 -1
  11. package/src/sap/base/util/restricted/_curry.js +1 -1
  12. package/src/sap/base/util/restricted/_debounce.js +1 -1
  13. package/src/sap/base/util/restricted/_difference.js +1 -1
  14. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  15. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  16. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  17. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  18. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  19. package/src/sap/base/util/restricted/_flatten.js +1 -1
  20. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  21. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  22. package/src/sap/base/util/restricted/_intersection.js +1 -1
  23. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  24. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  25. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  26. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  27. package/src/sap/base/util/restricted/_isNil.js +1 -1
  28. package/src/sap/base/util/restricted/_max.js +1 -1
  29. package/src/sap/base/util/restricted/_merge.js +1 -1
  30. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  31. package/src/sap/base/util/restricted/_min.js +1 -1
  32. package/src/sap/base/util/restricted/_omit.js +1 -1
  33. package/src/sap/base/util/restricted/_pick.js +1 -1
  34. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  35. package/src/sap/base/util/restricted/_throttle.js +1 -1
  36. package/src/sap/base/util/restricted/_toArray.js +1 -1
  37. package/src/sap/base/util/restricted/_union.js +1 -1
  38. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  39. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  40. package/src/sap/base/util/restricted/_uniq.js +1 -1
  41. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  42. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  43. package/src/sap/base/util/restricted/_without.js +1 -1
  44. package/src/sap/base/util/restricted/_xor.js +1 -1
  45. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  46. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  47. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  48. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  49. package/src/sap/ui/Device.js +3 -3
  50. package/src/sap/ui/Global.js +4 -4
  51. package/src/sap/ui/base/Event.js +1 -1
  52. package/src/sap/ui/base/EventProvider.js +1 -1
  53. package/src/sap/ui/base/Interface.js +1 -1
  54. package/src/sap/ui/base/ManagedObject.js +1 -1
  55. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  56. package/src/sap/ui/base/Metadata.js +1 -1
  57. package/src/sap/ui/base/Object.js +1 -1
  58. package/src/sap/ui/base/ObjectPool.js +1 -1
  59. package/src/sap/ui/core/.library +2 -2
  60. package/src/sap/ui/core/BusyIndicator.js +1 -1
  61. package/src/sap/ui/core/Component.js +58 -50
  62. package/src/sap/ui/core/ComponentContainer.js +1 -1
  63. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  64. package/src/sap/ui/core/ComponentSupport.js +1 -1
  65. package/src/sap/ui/core/Configuration.js +4 -1
  66. package/src/sap/ui/core/Control.js +19 -7
  67. package/src/sap/ui/core/Core.js +2 -1
  68. package/src/sap/ui/core/CustomData.js +1 -1
  69. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  70. package/src/sap/ui/core/Element.js +98 -3
  71. package/src/sap/ui/core/ElementMetadata.js +1 -1
  72. package/src/sap/ui/core/EnabledPropagator.js +16 -1
  73. package/src/sap/ui/core/EventBus.js +1 -1
  74. package/src/sap/ui/core/Fragment.js +1 -1
  75. package/src/sap/ui/core/HTML.js +1 -1
  76. package/src/sap/ui/core/History.js +1 -1
  77. package/src/sap/ui/core/Icon.js +10 -6
  78. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  79. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  80. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  81. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  82. package/src/sap/ui/core/InvisibleText.js +1 -1
  83. package/src/sap/ui/core/Item.js +1 -1
  84. package/src/sap/ui/core/LabelEnablement.js +1 -1
  85. package/src/sap/ui/core/LayoutData.js +1 -1
  86. package/src/sap/ui/core/ListItem.js +1 -1
  87. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  88. package/src/sap/ui/core/Locale.js +12 -11
  89. package/src/sap/ui/core/LocaleData.js +1 -1
  90. package/src/sap/ui/core/Manifest.js +1 -1
  91. package/src/sap/ui/core/Message.js +1 -1
  92. package/src/sap/ui/core/Patcher.js +35 -0
  93. package/src/sap/ui/core/Popup.js +1 -0
  94. package/src/sap/ui/core/RenderManager.js +286 -156
  95. package/src/sap/ui/core/Renderer.js +1 -1
  96. package/src/sap/ui/core/ResizeHandler.js +2 -2
  97. package/src/sap/ui/core/ScrollBar.js +1 -1
  98. package/src/sap/ui/core/SeparatorItem.js +1 -1
  99. package/src/sap/ui/core/Title.js +1 -1
  100. package/src/sap/ui/core/TooltipBase.js +1 -1
  101. package/src/sap/ui/core/UIArea.js +36 -4
  102. package/src/sap/ui/core/UIComponent.js +1 -1
  103. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  104. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  105. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  106. package/src/sap/ui/core/XMLComposite.js +1 -1
  107. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  108. package/src/sap/ui/core/_IconRegistry.js +1 -0
  109. package/src/sap/ui/core/cache/CacheManager.js +1 -1
  110. package/src/sap/ui/core/date/UI5Date.js +970 -0
  111. package/src/sap/ui/core/date/UniversalDate.js +803 -39
  112. package/src/sap/ui/core/date/UniversalDateUtils.js +170 -14
  113. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  114. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  115. package/src/sap/ui/core/dnd/DragAndDrop.js +26 -15
  116. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  117. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  118. package/src/sap/ui/core/dnd/DragInfo.js +5 -8
  119. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  120. package/src/sap/ui/core/format/DateFormat.js +39 -29
  121. package/src/sap/ui/core/format/FileSizeFormat.js +1 -0
  122. package/src/sap/ui/core/format/ListFormat.js +1 -0
  123. package/src/sap/ui/core/format/NumberFormat.js +31 -56
  124. package/src/sap/ui/core/format/TimezoneUtil.js +9 -7
  125. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  126. package/src/sap/ui/core/library.js +22 -3
  127. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  128. package/src/sap/ui/core/message/Message.js +1 -1
  129. package/src/sap/ui/core/message/MessageManager.js +1 -1
  130. package/src/sap/ui/core/message/MessageParser.js +1 -1
  131. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  132. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  133. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  134. package/src/sap/ui/core/mvc/JSView.js +1 -1
  135. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  136. package/src/sap/ui/core/mvc/View.js +1 -1
  137. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  138. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  139. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  140. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  141. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  142. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  143. package/src/sap/ui/core/routing/Router.js +4 -3
  144. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  145. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  146. package/src/sap/ui/core/service/Service.js +1 -1
  147. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  148. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  149. package/src/sap/ui/core/support/Plugin.js +1 -1
  150. package/src/sap/ui/core/support/Support.js +1 -1
  151. package/src/sap/ui/core/support/plugins/ControlTree.js +14 -20
  152. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  153. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  154. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  156. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  158. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  159. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  160. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  161. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  162. package/src/sap/ui/core/tmpl/Template.js +1 -1
  163. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  164. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  165. package/src/sap/ui/core/util/Export.js +1 -1
  166. package/src/sap/ui/core/util/ExportCell.js +1 -1
  167. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  168. package/src/sap/ui/core/util/ExportRow.js +1 -1
  169. package/src/sap/ui/core/util/ExportType.js +1 -1
  170. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  171. package/src/sap/ui/core/util/File.js +1 -1
  172. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  173. package/src/sap/ui/core/util/MockServer.js +1 -1
  174. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  175. package/src/sap/ui/core/util/XMLPreprocessor.js +1 -0
  176. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  177. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  178. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  179. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  180. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  181. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  182. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  183. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  184. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  185. package/src/sap/ui/core/ws/WebSocket.js +2 -1
  186. package/src/sap/ui/debug/ControlTree.js +1 -1
  187. package/src/sap/ui/debug/DebugEnv.js +1 -1
  188. package/src/sap/ui/debug/PropertyList.js +1 -1
  189. package/src/sap/ui/dom/isBehindOtherElement.js +11 -3
  190. package/src/sap/ui/model/ClientModel.js +1 -1
  191. package/src/sap/ui/model/CompositeDataState.js +1 -1
  192. package/src/sap/ui/model/CompositeType.js +1 -1
  193. package/src/sap/ui/model/DataState.js +1 -1
  194. package/src/sap/ui/model/MetaModel.js +1 -1
  195. package/src/sap/ui/model/Model.js +1 -11
  196. package/src/sap/ui/model/SelectionModel.js +1 -1
  197. package/src/sap/ui/model/SimpleType.js +1 -1
  198. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  199. package/src/sap/ui/model/Type.js +1 -1
  200. package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -0
  201. package/src/sap/ui/model/controlhelper/TreeBindingProxy.js +29 -15
  202. package/src/sap/ui/model/json/JSONModel.js +1 -1
  203. package/src/sap/ui/model/message/MessageModel.js +1 -1
  204. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  205. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  206. package/src/sap/ui/model/odata/ODataMetaModel.js +2 -2
  207. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  208. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  209. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  210. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  211. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  212. package/src/sap/ui/model/odata/type/Date.js +57 -21
  213. package/src/sap/ui/model/odata/type/DateTime.js +32 -3
  214. package/src/sap/ui/model/odata/type/DateTimeBase.js +62 -25
  215. package/src/sap/ui/model/odata/type/DateTimeOffset.js +35 -5
  216. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +6 -5
  217. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  218. package/src/sap/ui/model/odata/type/Double.js +1 -1
  219. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  220. package/src/sap/ui/model/odata/type/Int.js +1 -1
  221. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  222. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  223. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  224. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  225. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  226. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  227. package/src/sap/ui/model/odata/type/Single.js +1 -1
  228. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  229. package/src/sap/ui/model/odata/type/String.js +1 -1
  230. package/src/sap/ui/model/odata/type/Time.js +37 -2
  231. package/src/sap/ui/model/odata/type/TimeOfDay.js +39 -4
  232. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  233. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  234. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  235. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +1 -0
  236. package/src/sap/ui/model/odata/v2/ODataListBinding.js +11 -1
  237. package/src/sap/ui/model/odata/v2/ODataModel.js +4 -2
  238. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  239. package/src/sap/ui/model/odata/v4/AnnotationHelper.js +1 -1
  240. package/src/sap/ui/model/odata/v4/Context.js +98 -23
  241. package/src/sap/ui/model/odata/v4/ODataBinding.js +39 -9
  242. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +4 -4
  243. package/src/sap/ui/model/odata/v4/ODataListBinding.js +57 -21
  244. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +3 -4
  245. package/src/sap/ui/model/odata/v4/ODataModel.js +33 -8
  246. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +15 -12
  247. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +2 -2
  248. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +43 -8
  249. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +92 -28
  250. package/src/sap/ui/model/odata/v4/lib/_Cache.js +74 -24
  251. package/src/sap/ui/model/odata/v4/lib/_Helper.js +14 -3
  252. package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +12 -4
  253. package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +8 -3
  254. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +22 -14
  255. package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +8 -1
  256. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  257. package/src/sap/ui/model/type/Boolean.js +1 -1
  258. package/src/sap/ui/model/type/Currency.js +1 -1
  259. package/src/sap/ui/model/type/Date.js +1 -1
  260. package/src/sap/ui/model/type/DateInterval.js +190 -155
  261. package/src/sap/ui/model/type/DateTime.js +1 -1
  262. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  263. package/src/sap/ui/model/type/FileSize.js +1 -1
  264. package/src/sap/ui/model/type/Float.js +1 -1
  265. package/src/sap/ui/model/type/Integer.js +1 -1
  266. package/src/sap/ui/model/type/String.js +1 -1
  267. package/src/sap/ui/model/type/Time.js +1 -1
  268. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  269. package/src/sap/ui/model/type/Unit.js +1 -1
  270. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  271. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  272. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  273. package/src/sap/ui/qunit/utils/waitForThemeApplied.js +4 -5
  274. package/src/sap/ui/test/generic/TestBase.js +3 -3
  275. package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +4 -4
  276. package/src/sap/ui/thirdparty/jquery-mobile-custom.js +9 -1
  277. package/src/sap/ui/util/Storage.js +1 -1
  278. package/src/ui5loader-autoconfig.js +14 -11
  279. package/src/ui5loader.js +152 -3
@@ -136,7 +136,8 @@ sap.ui.define([
136
136
  * @private
137
137
  */
138
138
  _AggregationCache.prototype.addElements = function (vReadElements, iOffset, oCache, iStart) {
139
- var aElements = this.aElements;
139
+ var aElements = this.aElements,
140
+ sNodeProperty = this.oAggregation.$NodeProperty;
140
141
 
141
142
  function addElement(oElement, i) {
142
143
  var oOldElement = aElements[iOffset + i],
@@ -147,8 +148,8 @@ sap.ui.define([
147
148
  if (oOldElement === oElement) {
148
149
  return;
149
150
  }
150
- _AggregationHelper
151
- .beforeOverwritePlaceholder(oOldElement, oElement, oCache, iStart + i);
151
+ _AggregationHelper.beforeOverwritePlaceholder(oOldElement, oElement, oCache,
152
+ iStart + i, sNodeProperty);
152
153
  } else if (iOffset + i >= aElements.length) {
153
154
  throw new Error("Array index out of bounds: " + (iOffset + i));
154
155
  }
@@ -178,7 +179,8 @@ sap.ui.define([
178
179
  };
179
180
 
180
181
  /**
181
- * Deletes the "$apply" system query option before side effects are requested.
182
+ * Deletes the "$apply" system query option before side effects are requested and adds the
183
+ * NodeProperty path to the "$select" system query option (if not already present).
182
184
  *
183
185
  * @param {object} mQueryOptions
184
186
  * A modifiable map of key-value pairs representing the query string
@@ -192,6 +194,31 @@ sap.ui.define([
192
194
  throw new Error("Missing recursive hierarchy");
193
195
  }
194
196
  delete mQueryOptions.$apply;
197
+ if (!mQueryOptions.$select.includes(this.oAggregation.$NodeProperty)) {
198
+ mQueryOptions.$select.push(this.oAggregation.$NodeProperty);
199
+ }
200
+ };
201
+
202
+ /**
203
+ * Before trying to update the element with the given key predicate with the given new value
204
+ * via {@link sap.ui.model.odata.v4.lib._Helper.updateSelected} (which might fail due to key
205
+ * predicate checks), checks that the NodeProperty ("the hierarchy node value") has not changed.
206
+ *
207
+ * @param {string} sPredicate - A key predicate
208
+ * @param {object} oNewValue - The new value, which usually just contains parts of the old
209
+ * @throws {Error} In case of a structural change
210
+ *
211
+ * @see sap.ui.model.odata.v4.lib._CollectionCache#requestSideEffects
212
+ */
213
+ _AggregationCache.prototype.beforeUpdateSelected = function (sPredicate, oNewValue) {
214
+ var oElement = this.aElements.$byPredicate[sPredicate],
215
+ sNodeProperty = this.oAggregation.$NodeProperty;
216
+
217
+ if (oElement[sNodeProperty] !== oNewValue[sNodeProperty]) {
218
+ throw new Error("Unexpected structural change: " + sNodeProperty
219
+ + " from " + JSON.stringify(oElement[sNodeProperty])
220
+ + " to " + JSON.stringify(oNewValue[sNodeProperty]));
221
+ }
195
222
  };
196
223
 
197
224
  /**
@@ -747,7 +774,7 @@ sap.ui.define([
747
774
  * @param {sap.ui.model.odata.v4.lib._GroupLock} oGroupLock
748
775
  * A lock for the group to associate the requests with;
749
776
  * {@link sap.ui.model.odata.v4.lib._GroupLock#getUnlockedCopy} still needs to be called!
750
- * @returns {sap.ui.base.SyncPromise|undefined}
777
+ * @returns {Promise|undefined}
751
778
  * A promise resolving without a defined result when the read is finished, or rejecting in
752
779
  * case of an error; <code>undefined</code> in case no count needs to be read
753
780
  * @throws {Error}
@@ -938,8 +965,8 @@ sap.ui.define([
938
965
 
939
966
  /**
940
967
  * Replaces the given element, which is at the given position and has the given predicate, with
941
- * a placeholder which keeps all private annotations. The original element is removed from its
942
- * corresponding cache and must not be used any longer.
968
+ * a placeholder which keeps all private annotations plus the hierarchy node value. The original
969
+ * element is removed from its corresponding cache and must not be used any longer.
943
970
  *
944
971
  * @param {number} iIndex - Its index
945
972
  * @param {object} oElement - An element
@@ -948,16 +975,20 @@ sap.ui.define([
948
975
  * @private
949
976
  */
950
977
  _AggregationCache.prototype.replaceByPlaceholder = function (iIndex, oElement, sPredicate) {
978
+ var sNodeProperty = this.oAggregation.$NodeProperty,
979
+ oPlaceholder;
980
+
951
981
  if (_Helper.hasPrivateAnnotation(oElement, "placeholder")) {
952
982
  return;
953
983
  }
954
984
 
955
985
  _AggregationHelper.markSplicedStale(oElement);
956
- this.aElements[iIndex] = {
986
+ this.aElements[iIndex] = oPlaceholder = {
957
987
  "@$ui5._" : Object.assign(oElement["@$ui5._"], {placeholder : true}),
958
988
  "@$ui5.node.isExpanded" : oElement["@$ui5.node.isExpanded"],
959
989
  "@$ui5.node.level" : oElement["@$ui5.node.level"]
960
990
  };
991
+ oPlaceholder[sNodeProperty] = oElement[sNodeProperty];
961
992
  delete this.aElements.$byPredicate[sPredicate];
962
993
 
963
994
  // drop original element from its cache's collection
@@ -1081,6 +1112,10 @@ sap.ui.define([
1081
1112
 
1082
1113
  sPredicate = _Helper.getKeyPredicate(oElement, sMetaPath, mTypeForMetaPath);
1083
1114
  _Helper.setPrivateAnnotation(oElement, "predicate", sPredicate);
1115
+ if (sMetaPath !== oAggregation.$metaPath) { // related entity (via navigation property)
1116
+ return sPredicate;
1117
+ }
1118
+
1084
1119
  switch (oElement[sDrillStateProperty]) {
1085
1120
  case "expanded":
1086
1121
  bIsExpanded = true;
@@ -135,13 +135,16 @@ sap.ui.define([
135
135
  * The group level cache which the given element has been read from
136
136
  * @param {number} iIndex
137
137
  * The index of the given element within the cache's collection
138
+ * @param {string} [sNodeProperty]
139
+ * Optional property path to the hierarchy node value
138
140
  * @throws {Error}
139
141
  * In case an unexpected element or placeholder would be overwritten, or in case of a
140
142
  * structural change
141
143
  *
142
144
  * @private
143
145
  */
144
- beforeOverwritePlaceholder : function (oPlaceholder, oElement, oCache, iIndex) {
146
+ beforeOverwritePlaceholder : function (oPlaceholder, oElement, oCache, iIndex,
147
+ sNodeProperty) {
145
148
  var oParent = _Helper.getPrivateAnnotation(oPlaceholder, "parent");
146
149
 
147
150
  if (!_Helper.hasPrivateAnnotation(oPlaceholder, "placeholder")) {
@@ -157,16 +160,22 @@ sap.ui.define([
157
160
  }
158
161
  ["descendants", "filter", "predicate"].forEach(function (sAnnotation) {
159
162
  if (_Helper.hasPrivateAnnotation(oPlaceholder, sAnnotation)
160
- && _Helper.getPrivateAnnotation(oElement, sAnnotation)
161
- !== _Helper.getPrivateAnnotation(oPlaceholder, sAnnotation)) {
163
+ && _Helper.getPrivateAnnotation(oPlaceholder, sAnnotation)
164
+ !== _Helper.getPrivateAnnotation(oElement, sAnnotation)) {
162
165
  throw new Error("Unexpected structural change: " + sAnnotation);
163
166
  }
164
167
  });
168
+ if (sNodeProperty in oPlaceholder
169
+ && oPlaceholder[sNodeProperty] !== oElement[sNodeProperty]) {
170
+ throw new Error("Unexpected structural change: " + sNodeProperty
171
+ + " from " + JSON.stringify(oPlaceholder[sNodeProperty])
172
+ + " to " + JSON.stringify(oElement[sNodeProperty]));
173
+ }
165
174
 
166
175
  _Helper.copyPrivateAnnotation(oPlaceholder, "spliced", oElement);
167
176
  if ("@$ui5.node.isExpanded" in oPlaceholder) {
168
- if ((oElement["@$ui5.node.isExpanded"] === undefined)
169
- !== (oPlaceholder["@$ui5.node.isExpanded"] === undefined)) {
177
+ if ((oPlaceholder["@$ui5.node.isExpanded"] === undefined)
178
+ !== (oElement["@$ui5.node.isExpanded"] === undefined)) {
170
179
  throw new Error("Not a leaf anymore (or vice versa)");
171
180
  }
172
181
  oElement["@$ui5.node.isExpanded"] = oPlaceholder["@$ui5.node.isExpanded"];
@@ -397,8 +406,9 @@ sap.ui.define([
397
406
  * Builds the value for a "$apply" system query option based on the given data aggregation
398
407
  * information for a recursive hierarchy. If no query options are given, only a symbolic
399
408
  * "$apply" is constructed to avoid timing issues with metadata. The property paths for
400
- * DistanceFromRootProperty, DrillStateProperty, and LimitedDescendantCountProperty are
401
- * stored at <code>oAggregation</code> using a "$" prefix (if not already stored).
409
+ * DistanceFromRootProperty, DrillStateProperty, LimitedDescendantCountProperty, and
410
+ * NodeProperty are stored at <code>oAggregation</code> using a "$" prefix (if not already
411
+ * stored).
402
412
  *
403
413
  * @param {object} oAggregation
404
414
  * An object holding the information needed for a recursive hierarchy; see
@@ -415,8 +425,8 @@ sap.ui.define([
415
425
  * The value for a "$orderby" system query option; it is removed from the returned map and
416
426
  * turned into an "orderby()" transformation
417
427
  * @param {string[]} [mQueryOptions.$select]
418
- * The value for a "$select" system query option; additional technical properties are
419
- * added to the returned copy
428
+ * The value for a "$select" system query option; additional technical properties
429
+ * including NodeProperty ("the hierarchy node value") are added to the returned copy
420
430
  * @param {boolean} [bAllLevels]
421
431
  * Whether to expand all levels
422
432
  * @returns {object}
@@ -429,14 +439,12 @@ sap.ui.define([
429
439
  buildApply4Hierarchy : function (oAggregation, mQueryOptions, bAllLevels) {
430
440
  var sApply = "",
431
441
  sHierarchyQualifier = oAggregation.hierarchyQualifier,
442
+ sMetaPath = oAggregation.$metaPath,
443
+ sNodeProperty = oAggregation.$NodeProperty,
432
444
  sPath = oAggregation.$path,
433
- sNodeProperty = mQueryOptions
434
- ? oAggregation.$fetchMetadata(sPath
435
- + "/@Org.OData.Aggregation.V1.RecursiveHierarchy#" + sHierarchyQualifier
436
- + "/NodeProperty/$PropertyPath").getResult()
437
- : "???",
438
445
  mRecursiveHierarchy,
439
- sSeparator = "";
446
+ sSeparator = "",
447
+ oSyncPromise;
440
448
 
441
449
  function select(sProperty) {
442
450
  var sPropertyPath;
@@ -445,7 +453,7 @@ sap.ui.define([
445
453
  sPropertyPath = oAggregation["$" + sProperty];
446
454
  if (!sPropertyPath) {
447
455
  if (!mRecursiveHierarchy) {
448
- mRecursiveHierarchy = oAggregation.$fetchMetadata(sPath
456
+ mRecursiveHierarchy = oAggregation.$fetchMetadata(sMetaPath
449
457
  + "/@com.sap.vocabularies.Hierarchy.v1.RecursiveHierarchy#"
450
458
  + sHierarchyQualifier).getResult();
451
459
  }
@@ -457,9 +465,24 @@ sap.ui.define([
457
465
  }
458
466
  }
459
467
 
468
+ if (!sNodeProperty) {
469
+ sNodeProperty = "???";
470
+ if (mQueryOptions) {
471
+ oSyncPromise = oAggregation.$fetchMetadata(sMetaPath
472
+ + "/@Org.OData.Aggregation.V1.RecursiveHierarchy#" + sHierarchyQualifier
473
+ + "/NodeProperty/$PropertyPath");
474
+ if (oSyncPromise.isFulfilled()) {
475
+ sNodeProperty = oAggregation.$NodeProperty = oSyncPromise.getResult();
476
+ }
477
+ }
478
+ }
479
+
460
480
  mQueryOptions = Object.assign({}, mQueryOptions); // shallow clone
461
481
  if (mQueryOptions.$select) {
462
482
  mQueryOptions.$select = mQueryOptions.$select.slice();
483
+ if (!mQueryOptions.$select.includes(sNodeProperty)) {
484
+ mQueryOptions.$select.push(sNodeProperty);
485
+ }
463
486
  }
464
487
 
465
488
  if (mQueryOptions.$filter || oAggregation.search) {
@@ -491,7 +514,8 @@ sap.ui.define([
491
514
  sApply += "orderby(" + mQueryOptions.$orderby + ")/";
492
515
  delete mQueryOptions.$orderby;
493
516
  }
494
- sApply += "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root" + sPath
517
+ sApply += "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root"
518
+ + (sPath || "")
495
519
  + ",HierarchyQualifier='" + sHierarchyQualifier
496
520
  + "',NodeProperty='" + sNodeProperty
497
521
  + "',Levels=" + (bAllLevels ? 9 : oAggregation.expandTo || 1)
@@ -988,6 +1012,24 @@ sap.ui.define([
988
1012
  }
989
1013
  },
990
1014
 
1015
+ /**
1016
+ * Stores the given path and its corresponding meta path inside the given data aggregation
1017
+ * information as <code>$metaPath</code> and <code>$path</code>.
1018
+ *
1019
+ *
1020
+ * @param {object} oAggregation
1021
+ * An object holding the information needed for data aggregation; see
1022
+ * {@link sap.ui.model.odata.v4.ODataListBinding#setAggregation}.
1023
+ * @param {string} [sPath]
1024
+ * The list binding's absolute data path, <code>undefined</code> if currently unresolved
1025
+ *
1026
+ * @public
1027
+ */
1028
+ setPath : function (oAggregation, sPath) {
1029
+ oAggregation.$metaPath = sPath && _Helper.getMetaPath(sPath);
1030
+ oAggregation.$path = sPath;
1031
+ },
1032
+
991
1033
  /**
992
1034
  * Splits a filter depending on the aggregation information into an array that consists of
993
1035
  * two filters, one that must be applied after and one that must be applied before
@@ -1061,27 +1103,21 @@ sap.ui.define([
1061
1103
  },
1062
1104
 
1063
1105
  /**
1064
- * Validates the given data aggregation information. If successful, the given path and
1065
- * function are stored inside that information as <code>$path</code> and
1066
- * <code>$fetchMetadata</code> respectively.
1067
- *
1106
+ * Validates the given data aggregation information.
1068
1107
  *
1069
1108
  * @param {object} oAggregation
1070
1109
  * An object holding the information needed for data aggregation; see
1071
1110
  * {@link sap.ui.model.odata.v4.ODataListBinding#setAggregation}.
1072
- * @param {string} sPath
1073
- * The list binding's absolute data path
1074
- * @param {function} fnFetchMetadata
1075
- * Function which fetches metadata for a given meta path
1076
1111
  * @param {boolean} bAutoExpandSelect
1077
1112
  * The value of the model's parameter <code>autoExpandSelect</code>
1078
1113
  * @throws {Error}
1079
1114
  * If the given data aggregation object is unsupported, or if a recursive hierarchy is
1080
1115
  * requested, but the model does not use the <code>autoExpandSelect</code> parameter.
1081
1116
  *
1082
- * @public
1117
+ * @private
1118
+ * @see validateAggregationAndSetPath
1083
1119
  */
1084
- validateAggregation : function (oAggregation, sPath, fnFetchMetadata, bAutoExpandSelect) {
1120
+ validateAggregation : function (oAggregation, bAutoExpandSelect) {
1085
1121
  if (oAggregation.hierarchyQualifier && !bAutoExpandSelect) {
1086
1122
  throw new Error("Missing parameter autoExpandSelect at model");
1087
1123
  }
@@ -1089,9 +1125,37 @@ sap.ui.define([
1089
1125
  _AggregationHelper.checkTypeof(oAggregation,
1090
1126
  oAggregation.hierarchyQualifier ? mRecursiveHierarchyType : mDataAggregationType,
1091
1127
  "$$aggregation");
1128
+ },
1129
+
1130
+ /**
1131
+ * Validates the given data aggregation information. If successful, the given path and its
1132
+ * corresponding meta path as well as the given function are stored inside that information
1133
+ * as <code>$metaPath</code>, <code>$path</code>, and <code>$fetchMetadata</code>
1134
+ * respectively.
1135
+ *
1136
+ * @param {object} oAggregation
1137
+ * An object holding the information needed for data aggregation; see
1138
+ * {@link sap.ui.model.odata.v4.ODataListBinding#setAggregation}.
1139
+ * @param {boolean} bAutoExpandSelect
1140
+ * The value of the model's parameter <code>autoExpandSelect</code>
1141
+ * @param {function} fnFetchMetadata
1142
+ * Function which fetches metadata for a given meta path
1143
+ * @param {string} [sPath]
1144
+ * The list binding's absolute data path, <code>undefined</code> if currently unresolved
1145
+ * @throws {Error}
1146
+ * If the given data aggregation object is unsupported, or if a recursive hierarchy is
1147
+ * requested, but the model does not use the <code>autoExpandSelect</code> parameter.
1148
+ *
1149
+ * @public
1150
+ * @see setPath
1151
+ * @see validateAggregation
1152
+ */
1153
+ validateAggregationAndSetPath : function (oAggregation, bAutoExpandSelect, fnFetchMetadata,
1154
+ sPath) {
1155
+ _AggregationHelper.validateAggregation(oAggregation, bAutoExpandSelect);
1092
1156
 
1093
1157
  oAggregation.$fetchMetadata = fnFetchMetadata;
1094
- oAggregation.$path = sPath;
1158
+ _AggregationHelper.setPath(oAggregation, sPath);
1095
1159
  }
1096
1160
  };
1097
1161
 
@@ -224,6 +224,7 @@ sap.ui.define([
224
224
  throw new Error("No 'delete' allowed while waiting for server response");
225
225
  }
226
226
  that.oRequestor.removePost(sTransientGroup, oEntity);
227
+
227
228
  return undefined;
228
229
  }
229
230
 
@@ -460,9 +461,27 @@ sap.ui.define([
460
461
  fnResolve,
461
462
  that = this;
462
463
 
463
- // Clean-up when the create has been canceled.
464
- function cleanUp() {
465
- var iIndex = aCollection.indexOf(oEntityData);
464
+ /*
465
+ * Clean-up when the create has been canceled.
466
+ *
467
+ * @param {boolean} bResetInactive
468
+ * Whether an edited inactive entity should be reset instead of being removed.
469
+ * @returns {boolean}
470
+ * Whether the entity was reset only and kept in the collection instead of being removed.
471
+ *
472
+ * @see sap.ui.model.odata.v4.lib._Requestor#cancelChangesByFilter
473
+ */
474
+ function cleanUp(bResetInactive) {
475
+ var bInactiveEntity = oEntityData["@$ui5.context.isInactive"],
476
+ iIndex = aCollection.indexOf(oEntityData);
477
+
478
+ if (bResetInactive && bInactiveEntity) {
479
+ if (bInactiveEntity === 1) {
480
+ _Helper.resetInactiveEntity(that.mChangeListeners, sTransientPredicate,
481
+ oEntityData);
482
+ } // there is nothing to reset if the entity is simply inactive
483
+ return true;
484
+ }
466
485
 
467
486
  _Helper.removeByPath(that.mPostRequests, sPath, oEntityData);
468
487
  aCollection.splice(iIndex, 1);
@@ -830,7 +849,7 @@ sap.ui.define([
830
849
  * The path of the requested property relative to oResource; this property is requested from
831
850
  * the server. For annotations, except client annotations, the annotated property is requested
832
851
  * from the server.
833
- * @returns {sap.ui.base.SyncPromise|boolean}
852
+ * @returns {Promise|boolean}
834
853
  * A promise resolving w/o any result if the requested property is an expected late property,
835
854
  * or a <code>boolean</code> value if it is not; it rejects with an error if the GET request
836
855
  * failed, or if the key predicate or the ETag has changed. The returned <code>boolean</code>
@@ -1298,6 +1317,9 @@ sap.ui.define([
1298
1317
  * The key predicate of the entity; only evaluated if <code>iIndex === undefined</code>
1299
1318
  * @param {boolean} [bKeepAlive]
1300
1319
  * Whether the entity is kept-alive
1320
+ * @param {boolean} [bWithMessages]
1321
+ * Whether the "@com.sap.vocabularies.Common.v1.Messages" path is treated specially, supported
1322
+ * only for <code>sPath === ""</code>
1301
1323
  * @param {function} [fnDataRequested]
1302
1324
  * The function is called just before the back-end request is sent.
1303
1325
  * If no back-end request is needed, the function is not called.
@@ -1309,13 +1331,18 @@ sap.ui.define([
1309
1331
  * @public
1310
1332
  */
1311
1333
  _Cache.prototype.refreshSingle = function (oGroupLock, sPath, iIndex, sPredicate, bKeepAlive,
1312
- fnDataRequested) {
1313
- var that = this;
1334
+ bWithMessages, fnDataRequested) {
1335
+ var bKeepReportedMessagesPath = false,
1336
+ that = this;
1314
1337
 
1315
1338
  this.checkSharedRequest();
1316
1339
  return this.fetchValue(_GroupLock.$cached, sPath).then(function (aElements) {
1317
- var mQueryOptions
1318
- = Object.assign({}, _Helper.getQueryOptionsForPath(that.mQueryOptions, sPath)),
1340
+ var sMessagesPath = bWithMessages && sPath === ""
1341
+ && that.oRequestor.getModelInterface().fetchMetadata(
1342
+ that.sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path"
1343
+ ).getResult(),
1344
+ mQueryOptions = _Helper.clone(
1345
+ _Helper.getQueryOptionsForPath(that.mQueryOptions, sPath)),
1319
1346
  sReadUrl;
1320
1347
 
1321
1348
  if (iIndex !== undefined) {
@@ -1330,6 +1357,12 @@ sap.ui.define([
1330
1357
  // -> no need to apply _Helper.getQueryOptionsForPath
1331
1358
  _Helper.aggregateExpandSelect(mQueryOptions, that.mLateQueryOptions);
1332
1359
  }
1360
+ if (sMessagesPath && mQueryOptions.$select
1361
+ && !mQueryOptions.$select.includes(sMessagesPath)) {
1362
+ // Note: w/o existing $select, we must not end up w/ just messages
1363
+ mQueryOptions.$select.push(sMessagesPath);
1364
+ bKeepReportedMessagesPath = true;
1365
+ }
1333
1366
  // drop collection related system query options
1334
1367
  delete mQueryOptions.$apply;
1335
1368
  delete mQueryOptions.$count;
@@ -1347,7 +1380,8 @@ sap.ui.define([
1347
1380
  ]).then(function (aResult) {
1348
1381
  var oElement = aResult[0];
1349
1382
 
1350
- that.replaceElement(aElements, iIndex, sPredicate, oElement, aResult[1], sPath);
1383
+ that.replaceElement(aElements, iIndex, sPredicate, oElement, aResult[1], sPath,
1384
+ bKeepReportedMessagesPath);
1351
1385
  });
1352
1386
  });
1353
1387
  };
@@ -1606,11 +1640,13 @@ sap.ui.define([
1606
1640
  * A map from meta path to the entity type (as delivered by {@link #fetchTypes})
1607
1641
  * @param {string} sPath
1608
1642
  * The element collection's path within this cache, may be <code>""</code>
1643
+ * @param {boolean} [bKeepReportedMessagesPath]
1644
+ * Whether <code>this.sReportedMessagesPath</code> should be kept unchanged
1609
1645
  *
1610
1646
  * @private
1611
1647
  */
1612
1648
  _Cache.prototype.replaceElement = function (aElements, iIndex, sPredicate, oElement,
1613
- mTypeForMetaPath, sPath) {
1649
+ mTypeForMetaPath, sPath, bKeepReportedMessagesPath) {
1614
1650
  var oOldElement, sTransientPredicate;
1615
1651
 
1616
1652
  if (iIndex === undefined) { // kept-alive element not in the list
@@ -1633,7 +1669,8 @@ sap.ui.define([
1633
1669
 
1634
1670
  // Note: iStart is not needed here because we know we have a key predicate
1635
1671
  this.visitResponse(oElement, mTypeForMetaPath,
1636
- _Helper.getMetaPath(_Helper.buildPath(this.sMetaPath, sPath)), sPath + sPredicate);
1672
+ _Helper.getMetaPath(_Helper.buildPath(this.sMetaPath, sPath)), sPath + sPredicate,
1673
+ false, undefined, bKeepReportedMessagesPath);
1637
1674
  };
1638
1675
 
1639
1676
  /**
@@ -1734,7 +1771,11 @@ sap.ui.define([
1734
1771
  } else if (isSubPath(sRequestPath, sPath)) {
1735
1772
  for (i = aEntities.length - 1; i >= 0; i -= 1) {
1736
1773
  sTransientGroup = _Helper.getPrivateAnnotation(aEntities[i], "transient");
1737
- if (!sTransientGroup.startsWith("$inactive.")) {
1774
+ if (sTransientGroup.startsWith("$inactive.")) {
1775
+ _Helper.resetInactiveEntity(that.mChangeListeners,
1776
+ _Helper.getPrivateAnnotation(aEntities[i], "transientPredicate"),
1777
+ aEntities[i]);
1778
+ } else {
1738
1779
  // this also cleans up that.mPostRequests
1739
1780
  that.oRequestor.removePost(sTransientGroup, aEntities[i]);
1740
1781
  }
@@ -1914,7 +1955,7 @@ sap.ui.define([
1914
1955
  * @param {boolean} [bInactive]
1915
1956
  * If <code>true</code>, the cache and the POST request will be updated, but the entity stays
1916
1957
  * inactive
1917
- * @returns {Promise}
1958
+ * @returns {sap.ui.base.SyncPromise}
1918
1959
  * A promise for the PATCH request (resolves with <code>undefined</code>); rejected in case of
1919
1960
  * cancellation or if no <code>fnErrorCallback</code> is given
1920
1961
  * @throws {Error} If the cache is shared
@@ -2178,15 +2219,17 @@ sap.ui.define([
2178
2219
  * @param {boolean} [bKeepTransientPath] Whether the transient path shall be used to report
2179
2220
  * messages
2180
2221
  * @param {number} [iStart]
2181
- * The index in the collection where "oRoot.value" needs to be inserted or undefined if
2182
- * "oRoot" references a single entity
2222
+ * The index in the collection where "oRoot.value" needs to be inserted or undefined if
2223
+ * "oRoot" references a single entity.
2224
+ * @param {boolean} [bKeepReportedMessagesPath]
2225
+ * Whether <code>this.sReportedMessagesPath</code> should be kept unchanged
2183
2226
  * @throws {Error}
2184
2227
  * If the cache is shared and OData messages would be reported
2185
2228
  *
2186
2229
  * @private
2187
2230
  */
2188
2231
  _Cache.prototype.visitResponse = function (oRoot, mTypeForMetaPath, sRootMetaPath, sRootPath,
2189
- bKeepTransientPath, iStart) {
2232
+ bKeepTransientPath, iStart, bKeepReportedMessagesPath) {
2190
2233
  var aCachePaths,
2191
2234
  bHasMessages = false,
2192
2235
  mPathToODataMessages = {},
@@ -2343,8 +2386,10 @@ sap.ui.define([
2343
2386
  visitInstance(oRoot, sRootMetaPath || this.sMetaPath, sRootPath || "", sRequestUrl);
2344
2387
  }
2345
2388
  if (bHasMessages && !this.bSharedRequest) {
2346
- this.sReportedMessagesPath = this.sOriginalResourcePath;
2347
- this.oRequestor.getModelInterface().reportStateMessages(this.sReportedMessagesPath,
2389
+ if (!bKeepReportedMessagesPath) {
2390
+ this.sReportedMessagesPath = this.sOriginalResourcePath;
2391
+ }
2392
+ this.oRequestor.getModelInterface().reportStateMessages(this.sOriginalResourcePath,
2348
2393
  mPathToODataMessages, aCachePaths);
2349
2394
  }
2350
2395
  };
@@ -2857,7 +2902,7 @@ sap.ui.define([
2857
2902
  */
2858
2903
  _CollectionCache.prototype.isDeletingInOtherGroup = function (sGroupId) {
2859
2904
  return Object.values(this.aElements.$deleted || {}).some(function (oDeleted) {
2860
- return oDeleted.sGroupId !== sGroupId;
2905
+ return oDeleted.groupId !== sGroupId;
2861
2906
  });
2862
2907
  };
2863
2908
 
@@ -3034,7 +3079,7 @@ sap.ui.define([
3034
3079
  * @param {function(string,number)} fnOnRemove
3035
3080
  * A function which is called with predicate and index if a kept-alive or created element does
3036
3081
  * no longer exist after refresh; the index is undefined for a non-created element
3037
- * @returns {sap.ui.base.SyncPromise|undefined}
3082
+ * @returns {Promise|undefined}
3038
3083
  * A promise resolving without a defined result, or rejecting with an error if the refresh
3039
3084
  * fails, or <code>undefined</code> if there are no kept-alive elements.
3040
3085
  * @throws {Error}
@@ -3208,6 +3253,8 @@ sap.ui.define([
3208
3253
  * @param {boolean} bSingle
3209
3254
  * Whether only the side effects for a single element are requested; no element is discarded
3210
3255
  * in this case
3256
+ * @param {boolean} bWithMessages
3257
+ * Whether the "@com.sap.vocabularies.Common.v1.Messages" path is treated specially
3211
3258
  * @returns {Promise|sap.ui.base.SyncPromise}
3212
3259
  * A promise resolving without a defined result, or rejecting with an error if loading of side
3213
3260
  * effects fails
@@ -3218,7 +3265,7 @@ sap.ui.define([
3218
3265
  * @public
3219
3266
  */
3220
3267
  _CollectionCache.prototype.requestSideEffects = function (oGroupLock, aPaths, aPredicates,
3221
- bSingle) {
3268
+ bSingle, bWithMessages) {
3222
3269
  var aElements,
3223
3270
  mMergeableQueryOptions,
3224
3271
  mQueryOptions,
@@ -3231,7 +3278,7 @@ sap.ui.define([
3231
3278
 
3232
3279
  mQueryOptions = _Helper.intersectQueryOptions(
3233
3280
  Object.assign({}, this.mQueryOptions, this.mLateQueryOptions), aPaths,
3234
- this.oRequestor.getModelInterface().fetchMetadata, this.sMetaPath, "");
3281
+ this.oRequestor.getModelInterface().fetchMetadata, this.sMetaPath, "", bWithMessages);
3235
3282
  if (!mQueryOptions) {
3236
3283
  return SyncPromise.resolve(); // micro optimization: use *sync.* promise which is cached
3237
3284
  }
@@ -3292,10 +3339,13 @@ sap.ui.define([
3292
3339
  }
3293
3340
  // Note: iStart makes no sense here (use NaN instead), but is not needed because
3294
3341
  // we know we have key predicates
3295
- that.visitResponse(oResult, mTypeForMetaPath, undefined, "", false, NaN);
3342
+ that.visitResponse(oResult, mTypeForMetaPath, undefined, "", false, NaN, true);
3296
3343
  for (i = 0, n = oResult.value.length; i < n; i += 1) {
3297
3344
  oElement = oResult.value[i];
3298
3345
  sPredicate = _Helper.getPrivateAnnotation(oElement, "predicate");
3346
+ if (that.beforeUpdateSelected) {
3347
+ that.beforeUpdateSelected(sPredicate, oElement);
3348
+ }
3299
3349
  _Helper.updateSelected(that.mChangeListeners, sPredicate,
3300
3350
  that.aElements.$byPredicate[sPredicate], oElement, aPaths,
3301
3351
  preventKeyPredicateChange);
@@ -3799,7 +3849,7 @@ sap.ui.define([
3799
3849
  * because they may have changed due to side effects of a previous update
3800
3850
  * @param {string} [sResourcePath=this.sResourcePath]
3801
3851
  * A resource path relative to the service URL; it must not contain a query string
3802
- * @returns {Promise|sap.ui.base.SyncPromise}
3852
+ * @returns {sap.ui.base.SyncPromise}
3803
3853
  * A promise resolving without a defined result, or rejecting with an error if loading of side
3804
3854
  * effects fails.
3805
3855
  * @throws {Error} If the side effects require a $expand, if group ID is '$cached' (the error
@@ -1618,6 +1618,8 @@ sap.ui.define([
1618
1618
  * identifier may be appended
1619
1619
  * @param {string} [sPrefix=""]
1620
1620
  * Optional prefix for navigation property meta paths used during recursion
1621
+ * @param {boolean} bWithMessages
1622
+ * Whether the "@com.sap.vocabularies.Common.v1.Messages" path is treated specially
1621
1623
  * @returns {object}
1622
1624
  * The updated query options or <code>null</code> if no request is needed
1623
1625
  * @throws {Error}
@@ -1625,9 +1627,11 @@ sap.ui.define([
1625
1627
  * collection-valued navigation property
1626
1628
  */
1627
1629
  intersectQueryOptions : function (mCacheQueryOptions, aPaths, fnFetchMetadata,
1628
- sRootMetaPath, sPrefix) {
1630
+ sRootMetaPath, sPrefix, bWithMessages) {
1629
1631
  var aExpands = [],
1630
1632
  mExpands = {},
1633
+ sMessagesPath = bWithMessages && fnFetchMetadata(sRootMetaPath
1634
+ + "/@com.sap.vocabularies.Common.v1.Messages/$Path").getResult(),
1631
1635
  mResult,
1632
1636
  oRootMetaData,
1633
1637
  aSelects,
@@ -1661,10 +1665,16 @@ sap.ui.define([
1661
1665
 
1662
1666
  if (aPaths.indexOf("*") >= 0) {
1663
1667
  aSelects = (mCacheQueryOptions && mCacheQueryOptions.$select || []).slice();
1668
+ if (sMessagesPath && !aSelects.includes(sMessagesPath)) {
1669
+ aSelects.push(sMessagesPath);
1670
+ }
1664
1671
  } else if (mCacheQueryOptions && mCacheQueryOptions.$select
1665
1672
  && mCacheQueryOptions.$select.indexOf("*") < 0) {
1666
1673
  _Helper.addChildrenWithAncestor(aPaths, mCacheQueryOptions.$select, mSelects);
1667
1674
  _Helper.addChildrenWithAncestor(mCacheQueryOptions.$select, aPaths, mSelects);
1675
+ if (sMessagesPath && aPaths.includes(sMessagesPath)) {
1676
+ mSelects[sMessagesPath] = true;
1677
+ }
1668
1678
  aSelects = Object.keys(mSelects).filter(filterStructural.bind(null, true));
1669
1679
  } else {
1670
1680
  aSelects = aPaths.filter(filterStructural.bind(null, false));
@@ -1997,8 +2007,8 @@ sap.ui.define([
1997
2007
  /**
1998
2008
  * Restores an entity and its POST body to the initial state which is read from a private
1999
2009
  * annotation. Key-value pairs are deleted if they are not in the initial state. Change
2000
- * listeners are notified about the changed or deleted values, and the "inactive" flag is
2001
- * reset to <code>true</code>.
2010
+ * listeners are notified about the changed or deleted values, and the "inactive" flag at
2011
+ * the entity and at its corresponding context is reset to <code>true</code>.
2002
2012
  *
2003
2013
  * @param {object} mChangeListeners - A map of change listeners by path
2004
2014
  * @param {string} sPath - The path to the entity; used to notify change listeners
@@ -2021,6 +2031,7 @@ sap.ui.define([
2021
2031
  _Helper.updateAll(mChangeListeners, sPath, oEntity,
2022
2032
  {"@$ui5.context.isInactive" : true}
2023
2033
  );
2034
+ _Helper.getPrivateAnnotation(oEntity, "context").setInactive();
2024
2035
  },
2025
2036
 
2026
2037
  /**