@openui5/sap.ui.core 1.96.2 → 1.97.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 (302) hide show
  1. package/.eslintrc.json +2 -2
  2. package/.reuse/dep5 +1 -1
  3. package/THIRDPARTY.txt +2 -1
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +1 -1
  6. package/src/jquery.sap.properties.js +1 -1
  7. package/src/jquery.sap.resources.js +2 -2
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  11. package/src/sap/base/util/restricted/_castArray.js +1 -1
  12. package/src/sap/base/util/restricted/_compact.js +1 -1
  13. package/src/sap/base/util/restricted/_curry.js +1 -1
  14. package/src/sap/base/util/restricted/_debounce.js +1 -1
  15. package/src/sap/base/util/restricted/_difference.js +1 -1
  16. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  17. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  18. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  19. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  20. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  21. package/src/sap/base/util/restricted/_flatten.js +1 -1
  22. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  23. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  24. package/src/sap/base/util/restricted/_intersection.js +1 -1
  25. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  26. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  27. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  28. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  29. package/src/sap/base/util/restricted/_isNil.js +1 -1
  30. package/src/sap/base/util/restricted/_max.js +1 -1
  31. package/src/sap/base/util/restricted/_merge.js +1 -1
  32. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  33. package/src/sap/base/util/restricted/_min.js +1 -1
  34. package/src/sap/base/util/restricted/_omit.js +1 -1
  35. package/src/sap/base/util/restricted/_pick.js +1 -1
  36. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  37. package/src/sap/base/util/restricted/_throttle.js +1 -1
  38. package/src/sap/base/util/restricted/_toArray.js +1 -1
  39. package/src/sap/base/util/restricted/_union.js +1 -1
  40. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  41. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  42. package/src/sap/base/util/restricted/_uniq.js +1 -1
  43. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  44. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  45. package/src/sap/base/util/restricted/_without.js +1 -1
  46. package/src/sap/base/util/restricted/_xor.js +1 -1
  47. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  48. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  49. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  50. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  51. package/src/sap/ui/Device.js +4 -4
  52. package/src/sap/ui/Global.js +11 -16
  53. package/src/sap/ui/base/Event.js +1 -1
  54. package/src/sap/ui/base/EventProvider.js +1 -1
  55. package/src/sap/ui/base/Interface.js +1 -1
  56. package/src/sap/ui/base/ManagedObject.js +3 -3
  57. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  58. package/src/sap/ui/base/Metadata.js +1 -3
  59. package/src/sap/ui/base/Object.js +1 -1
  60. package/src/sap/ui/base/ObjectPool.js +1 -1
  61. package/src/sap/ui/core/.library +1 -27
  62. package/src/sap/ui/core/AppCacheBuster.js +4 -4
  63. package/src/sap/ui/core/BusyIndicator.js +1 -1
  64. package/src/sap/ui/core/Component.js +31 -9
  65. package/src/sap/ui/core/ComponentContainer.js +1 -1
  66. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  67. package/src/sap/ui/core/ComponentSupport.js +1 -1
  68. package/src/sap/ui/core/Control.js +2 -2
  69. package/src/sap/ui/core/Core.js +2 -2
  70. package/src/sap/ui/core/CustomData.js +1 -1
  71. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  72. package/src/sap/ui/core/Element.js +2 -6
  73. package/src/sap/ui/core/ElementMetadata.js +1 -1
  74. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  75. package/src/sap/ui/core/EventBus.js +1 -1
  76. package/src/sap/ui/core/Fragment.js +1 -1
  77. package/src/sap/ui/core/HTML.js +3 -3
  78. package/src/sap/ui/core/History.js +1 -1
  79. package/src/sap/ui/core/Icon.js +1 -1
  80. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  81. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  82. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  83. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  84. package/src/sap/ui/core/InvisibleText.js +1 -1
  85. package/src/sap/ui/core/Item.js +1 -1
  86. package/src/sap/ui/core/LabelEnablement.js +1 -1
  87. package/src/sap/ui/core/LayoutData.js +1 -1
  88. package/src/sap/ui/core/ListItem.js +1 -1
  89. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  90. package/src/sap/ui/core/Locale.js +1 -1
  91. package/src/sap/ui/core/LocaleData.js +3 -3
  92. package/src/sap/ui/core/Manifest.js +1 -1
  93. package/src/sap/ui/core/Message.js +1 -1
  94. package/src/sap/ui/core/RenderManager.js +3 -3
  95. package/src/sap/ui/core/Renderer.js +1 -1
  96. package/src/sap/ui/core/ResizeHandler.js +1 -1
  97. package/src/sap/ui/core/ScrollBar.js +4 -3
  98. package/src/sap/ui/core/SeparatorItem.js +1 -1
  99. package/src/sap/ui/core/ThemeCheck.js +2 -2
  100. package/src/sap/ui/core/Title.js +1 -1
  101. package/src/sap/ui/core/TooltipBase.js +1 -1
  102. package/src/sap/ui/core/UIArea.js +3 -3
  103. package/src/sap/ui/core/UIComponent.js +1 -1
  104. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  105. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  106. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  107. package/src/sap/ui/core/XMLComposite.js +1 -1
  108. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  109. package/src/sap/ui/core/XMLTemplateProcessor.js +19 -5
  110. package/src/sap/ui/core/cache/LRUPersistentCache.js +4 -2
  111. package/src/sap/ui/core/date/UniversalDateUtils.js +33 -0
  112. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  113. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  114. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  115. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  116. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  117. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  118. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  119. package/src/sap/ui/core/library.js +5 -5
  120. package/src/sap/ui/core/message/ControlMessageProcessor.js +5 -5
  121. package/src/sap/ui/core/message/Message.js +1 -1
  122. package/src/sap/ui/core/message/MessageManager.js +1 -1
  123. package/src/sap/ui/core/message/MessageParser.js +1 -1
  124. package/src/sap/ui/core/message/MessageProcessor.js +22 -12
  125. package/src/sap/ui/core/messagebundle_fr.properties +7 -7
  126. package/src/sap/ui/core/messagebundle_ru.properties +21 -21
  127. package/src/sap/ui/core/mvc/Controller.js +4 -4
  128. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  129. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  130. package/src/sap/ui/core/mvc/JSView.js +1 -1
  131. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  132. package/src/sap/ui/core/mvc/View.js +1 -1
  133. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  134. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  135. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  136. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  137. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  138. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  139. package/src/sap/ui/core/rules/Misc.support.js +51 -1
  140. package/src/sap/ui/core/rules/Rendering.support.js +1 -4
  141. package/src/sap/ui/core/rules/View.support.js +14 -46
  142. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  143. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  144. package/src/sap/ui/core/service/Service.js +1 -1
  145. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  146. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  147. package/src/sap/ui/core/support/Plugin.js +2 -2
  148. package/src/sap/ui/core/support/RuleEngineOpaExtension.js +0 -1
  149. package/src/sap/ui/core/support/Support.js +1 -1
  150. package/src/sap/ui/core/support/controls/TreeViewer.js +1 -1
  151. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  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 -2
  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/support/techinfo/TechnicalInfo.js +1 -1
  160. package/src/sap/ui/core/support/trace/E2eTraceLib.js +3 -3
  161. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  162. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  163. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  164. package/src/sap/ui/core/tmpl/Template.js +1 -1
  165. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  166. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  167. package/src/sap/ui/core/util/Export.js +1 -1
  168. package/src/sap/ui/core/util/ExportCell.js +1 -1
  169. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  170. package/src/sap/ui/core/util/ExportRow.js +1 -1
  171. package/src/sap/ui/core/util/ExportType.js +1 -1
  172. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  173. package/src/sap/ui/core/util/File.js +1 -1
  174. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  175. package/src/sap/ui/core/util/MockServer.js +2 -2
  176. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  177. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +4 -4
  178. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  179. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  180. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  181. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  182. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  183. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  184. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  185. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  186. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  187. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  188. package/src/sap/ui/debug/ControlTree.js +1 -1
  189. package/src/sap/ui/debug/DebugEnv.js +1 -1
  190. package/src/sap/ui/debug/PropertyList.js +1 -1
  191. package/src/sap/ui/model/ChangeReason.js +1 -1
  192. package/src/sap/ui/model/ClientListBinding.js +7 -0
  193. package/src/sap/ui/model/ClientModel.js +6 -5
  194. package/src/sap/ui/model/ClientTreeBindingAdapter.js +1 -1
  195. package/src/sap/ui/model/CompositeDataState.js +1 -1
  196. package/src/sap/ui/model/CompositeType.js +1 -1
  197. package/src/sap/ui/model/DataState.js +1 -1
  198. package/src/sap/ui/model/ListBinding.js +24 -5
  199. package/src/sap/ui/model/MetaModel.js +1 -1
  200. package/src/sap/ui/model/Model.js +5 -10
  201. package/src/sap/ui/model/SelectionModel.js +1 -1
  202. package/src/sap/ui/model/SimpleType.js +1 -1
  203. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  204. package/src/sap/ui/model/TreeBindingAdapter.js +0 -2
  205. package/src/sap/ui/model/TreeBindingUtils.js +2 -0
  206. package/src/sap/ui/model/Type.js +1 -1
  207. package/src/sap/ui/model/analytics/AnalyticalBinding.js +12 -6
  208. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +16 -18
  209. package/src/sap/ui/model/json/JSONModel.js +7 -7
  210. package/src/sap/ui/model/json/JSONPropertyBinding.js +1 -1
  211. package/src/sap/ui/model/message/MessageModel.js +3 -3
  212. package/src/sap/ui/model/message/MessagePropertyBinding.js +1 -1
  213. package/src/sap/ui/model/odata/AnnotationHelper.js +2 -2
  214. package/src/sap/ui/model/odata/AnnotationParser.js +4 -2
  215. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  216. package/src/sap/ui/model/odata/ODataListBinding.js +61 -38
  217. package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
  218. package/src/sap/ui/model/odata/ODataMetaModel.js +3 -3
  219. package/src/sap/ui/model/odata/ODataMetadata.js +136 -85
  220. package/src/sap/ui/model/odata/ODataModel.js +442 -215
  221. package/src/sap/ui/model/odata/ODataPropertyBinding.js +7 -5
  222. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +27 -17
  223. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +440 -260
  224. package/src/sap/ui/model/odata/ODataUtils.js +24 -9
  225. package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +2 -1
  226. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +10 -8
  227. package/src/sap/ui/model/odata/_ODataMetaModelUtils.js +6 -4
  228. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  229. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  230. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  231. package/src/sap/ui/model/odata/type/Date.js +1 -1
  232. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  233. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  234. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  235. package/src/sap/ui/model/odata/type/Decimal.js +5 -1
  236. package/src/sap/ui/model/odata/type/Double.js +1 -1
  237. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  238. package/src/sap/ui/model/odata/type/Int.js +1 -1
  239. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  240. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  241. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  242. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  243. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  244. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  245. package/src/sap/ui/model/odata/type/Single.js +1 -1
  246. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  247. package/src/sap/ui/model/odata/type/String.js +1 -1
  248. package/src/sap/ui/model/odata/type/Time.js +1 -1
  249. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  250. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  251. package/src/sap/ui/model/odata/type/UnitMixin.js +0 -1
  252. package/src/sap/ui/model/odata/v2/Context.js +42 -11
  253. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  254. package/src/sap/ui/model/odata/v2/ODataListBinding.js +205 -88
  255. package/src/sap/ui/model/odata/v2/ODataModel.js +154 -89
  256. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +162 -89
  257. package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +52 -2
  258. package/src/sap/ui/model/odata/v4/Context.js +48 -7
  259. package/src/sap/ui/model/odata/v4/ODataBinding.js +55 -24
  260. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +67 -19
  261. package/src/sap/ui/model/odata/v4/ODataListBinding.js +211 -78
  262. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
  263. package/src/sap/ui/model/odata/v4/ODataModel.js +2 -1
  264. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +36 -23
  265. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
  266. package/src/sap/ui/model/odata/v4/lib/_Cache.js +106 -11
  267. package/src/sap/ui/model/odata/v4/lib/_Helper.js +33 -3
  268. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +11 -2
  269. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  270. package/src/sap/ui/model/type/Boolean.js +1 -1
  271. package/src/sap/ui/model/type/Currency.js +1 -1
  272. package/src/sap/ui/model/type/Date.js +1 -1
  273. package/src/sap/ui/model/type/DateInterval.js +1 -1
  274. package/src/sap/ui/model/type/DateTime.js +1 -1
  275. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  276. package/src/sap/ui/model/type/FileSize.js +1 -1
  277. package/src/sap/ui/model/type/Float.js +1 -1
  278. package/src/sap/ui/model/type/Integer.js +1 -1
  279. package/src/sap/ui/model/type/String.js +1 -1
  280. package/src/sap/ui/model/type/Time.js +1 -1
  281. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  282. package/src/sap/ui/model/type/Unit.js +1 -1
  283. package/src/sap/ui/model/xml/XMLModel.js +5 -5
  284. package/src/sap/ui/model/xml/XMLPropertyBinding.js +1 -1
  285. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  286. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  287. package/src/sap/ui/test/actions/Action.js +9 -2
  288. package/src/sap/ui/test/actions/Press.js +28 -1
  289. package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +111 -0
  290. package/src/sap/ui/util/Mobile.js +28 -39
  291. package/src/sap/ui/util/Storage.js +1 -1
  292. package/src/ui5loader.js +6 -6
  293. package/ui5.yaml +244 -1
  294. package/src/sap/ui/core/CustomizingConfiguration.js +0 -47
  295. package/src/sap/ui/thirdparty/baseuri.js +0 -1
  296. package/src/sap/ui/thirdparty/es6-object-assign.js +0 -1
  297. package/src/sap/ui/thirdparty/es6-promise.js +0 -1
  298. package/src/sap/ui/thirdparty/es6-shim-nopromise.js +0 -1
  299. package/src/sap/ui/thirdparty/es6-string-methods.js +0 -1
  300. package/src/sap/ui/thirdparty/flexie.js +0 -1
  301. package/src/sap/ui/thirdparty/unorm.js +0 -1
  302. package/src/sap/ui/thirdparty/unormdata.js +0 -1
@@ -30,8 +30,6 @@ sap.ui.define([
30
30
  CountMode, ODataFilter, ODataUtils, OperationMode) {
31
31
  "use strict";
32
32
 
33
- /*global Set */
34
-
35
33
  var aCreateParametersAllowlist = ["changeSetId", "error", "expand", "groupId", "success"];
36
34
 
37
35
  /**
@@ -138,16 +136,14 @@ sap.ui.define([
138
136
  this.bThresholdRejected = true;
139
137
  }
140
138
 
141
- var bUseExpandedList = this.checkExpandedList();
142
- if (!bUseExpandedList) {
139
+ if (!this.checkExpandedList()) {
140
+ this._removePersistedCreatedContexts();
143
141
  this.resetData();
144
142
  }
145
143
  },
146
144
 
147
145
  metadata : {
148
- publicMethods : [
149
- "getLength"
150
- ]
146
+ publicMethods : ["getLength"]
151
147
  }
152
148
 
153
149
  });
@@ -232,6 +228,12 @@ sap.ui.define([
232
228
 
233
229
  if (this.bRefresh) {
234
230
  this.bRefresh = false;
231
+ // if we do not need to load data after a refresh event (e.g. we have enough created
232
+ // contexts) we need to fire a change event to fulfill the contract that after a refresh
233
+ // event a change event is triggered when the data is available.
234
+ if (!aContexts.dataRequested && aContexts.length > 0) {
235
+ this._fireChange({reason : ChangeReason.Change});
236
+ }
235
237
  } else {
236
238
  // Do not create context data and diff in case of refresh, only if real data has been received
237
239
  // The current behaviour is wrong and makes diff detection useless for OData in case of refresh
@@ -262,6 +264,9 @@ sap.ui.define([
262
264
  * As in OData all entities have a unique ID in the URL, the path of the
263
265
  * context is suitable here.
264
266
  *
267
+ * @param {sap.ui.model.Context} oContext The context
268
+ * @returns {string} The entry key for the given context
269
+ *
265
270
  * @private
266
271
  */
267
272
  ODataListBinding.prototype.getEntryKey = function(oContext) {
@@ -271,7 +276,14 @@ sap.ui.define([
271
276
  /**
272
277
  * Returns the entry data as required for change detection/diff.
273
278
  *
274
- * This is a JSON serialization of the entity, in case select/expand were used with only the selected/expanded parts.
279
+ * This is a JSON serialization of the entity, in case select/expand were used with only the
280
+ * selected/expanded parts.
281
+ *
282
+ * @param {sap.ui.model.Context} oContext
283
+ * The context
284
+ * @returns {any}
285
+ * The value for the given context or <code>undefined</code> if data or entity type
286
+ * cannot be found or if not all selected properties are available
275
287
  *
276
288
  * @private
277
289
  */
@@ -327,6 +339,10 @@ sap.ui.define([
327
339
  /**
328
340
  * Setter for context.
329
341
  *
342
+ * Entities that have been created via {@link #create} and saved in the back end are removed
343
+ * from the creation rows area and inserted at the right position based on the current filters
344
+ * and sorters.
345
+ *
330
346
  * @param {Object} oContext
331
347
  * The new context object
332
348
  * @throws {Error}
@@ -387,6 +403,7 @@ sap.ui.define([
387
403
  this.abortPendingRequest();
388
404
  this._fireChange({reason : ChangeReason.Context});
389
405
  } else {
406
+ this._removePersistedCreatedContexts();
390
407
  this._refresh();
391
408
  }
392
409
  }
@@ -479,19 +496,78 @@ sap.ui.define([
479
496
  };
480
497
 
481
498
  /**
482
- * Load data from model.
499
+ * Adds the $filter query option to the given array of URL parameters if needed.
500
+ * The application/control filters, as stored in <code>this.sFilterParams</code> are considered
501
+ * only if the given <code>bUseFilterParams</code> is set. The exclude filter for created
502
+ * persisted entities is always considered to avoid duplicates or a wrong count.
503
+ *
504
+ * @param {string[]} aURLParams The array of URL parameters
505
+ * @param {boolean} bUseFilterParams Whether to consider <code>this.sFilterParams</code>
506
+ *
507
+ * @private
508
+ */
509
+ ODataListBinding.prototype._addFilterQueryOption = function (aURLParams, bUseFilterParams) {
510
+ var sExcludeFilter = this._getCreatedPersistedExcludeFilter();
511
+
512
+ if (this.sFilterParams && bUseFilterParams) {
513
+ if (sExcludeFilter) {
514
+ // this.sFilterParams starts with $filter=, so slice it
515
+ aURLParams.push("$filter=(" + this.sFilterParams.slice(8) + ")%20and%20"
516
+ + sExcludeFilter);
517
+ } else {
518
+ aURLParams.push(this.sFilterParams);
519
+ }
520
+ } else if (sExcludeFilter) {
521
+ aURLParams.push("$filter=" + sExcludeFilter);
522
+ }
523
+ };
524
+
525
+ /**
526
+ * Gets the exclude filter for the created and persisted contexts of this list binding.
527
+ *
528
+ * @returns {string|undefined} The exclude filter or <code>undefined</code> if there are no
529
+ * created and persisted contexts in the cache.
530
+ *
531
+ * @private
532
+ */
533
+ ODataListBinding.prototype._getCreatedPersistedExcludeFilter = function () {
534
+ var sExcludeFilter, aExcludeFilters,
535
+ aCreatedPersistedContexts = this._getCreatedContexts().filter(function (oContext) {
536
+ return !oContext.isTransient();
537
+ }),
538
+ that = this;
539
+
540
+ if (aCreatedPersistedContexts.length > 0) {
541
+ aExcludeFilters = aCreatedPersistedContexts.map(function (oContext) {
542
+ var sPath = oContext.getPath();
543
+
544
+ return that._getFilterForPredicate(sPath.slice(sPath.indexOf("(")));
545
+ });
546
+ sExcludeFilter = "not("
547
+ + ODataUtils._createFilterParams(aExcludeFilters.length === 1
548
+ ? aExcludeFilters[0]
549
+ : new Filter({filters : aExcludeFilters}),
550
+ this.oModel.oMetadata, this.oEntityType)
551
+ + ")";
552
+ }
553
+
554
+ return sExcludeFilter;
555
+ };
556
+
557
+ /**
558
+ * Load data for the given range from server.
483
559
  *
484
560
  * @param {int} iStartIndex The start index
485
- * @param {int} iLength The count of data to be requested
486
- * Load list data from the server
561
+ * @param {int} iLength The amount of data to be requested
487
562
  * @private
488
563
  */
489
564
  ODataListBinding.prototype.loadData = function(iStartIndex, iLength) {
490
-
491
- var that = this,
492
- bInlineCountRequested = false,
493
- sGuid = uid(),
494
- sGroupId;
565
+ var sGroupId,
566
+ sGuid = uid(),
567
+ bInlineCountRequested = false,
568
+ aParams = [],
569
+ sPath = this.sPath,
570
+ that = this;
495
571
 
496
572
  // create range parameters and store start index for sort/filter requests
497
573
  if (iStartIndex || iLength) {
@@ -503,18 +579,13 @@ sap.ui.define([
503
579
 
504
580
  // create the request url
505
581
  // $skip/$top and are excluded for OperationMode.Client and Auto if the threshold was sufficient
506
- var aParams = [];
507
582
  if (this.sRangeParams && !this.useClientMode()) {
508
583
  aParams.push(this.sRangeParams);
509
584
  }
510
585
  if (this.sSortParams) {
511
586
  aParams.push(this.sSortParams);
512
587
  }
513
- // When in OperationMode.Auto, the filters are excluded and applied clientside,
514
- // except when the threshold was rejected, and the binding will internally run in Server Mode
515
- if (this.sFilterParams && !this.useClientMode()) {
516
- aParams.push(this.sFilterParams);
517
- }
588
+ this._addFilterQueryOption(aParams, !this.useClientMode());
518
589
  if (this.sCustomParams) {
519
590
  aParams.push(this.sCustomParams);
520
591
  }
@@ -567,48 +638,46 @@ sap.ui.define([
567
638
  that.bLengthFinal = true;
568
639
  that.applyFilter();
569
640
  that.applySort();
570
- } else {
571
641
  // For server mode, update data and or length dependent on the current result
572
- if (oData.results.length > 0) {
573
- // Collecting contexts, after the $inlinecount was evaluated, so we do not have to clear it again when
574
- // the Auto modes initial threshold <> count check failed.
575
- each(oData.results, function(i, entry) {
576
- that.aKeys[iStartIndex + i] = that.oModel._getKey(entry);
577
- });
642
+ } else if (oData.results.length > 0) {
643
+ // Collecting contexts, after the <code>$inlinecount</code> was evaluated, so we do
644
+ // not have to clear it again when Auto modes initial threshold <> count check
645
+ // failed.
646
+ each(oData.results, function(i, entry) {
647
+ that.aKeys[iStartIndex + i] = that.oModel._getKey(entry);
648
+ });
578
649
 
579
- // if we got data and the results + startindex is larger than the
580
- // length we just apply this value to the length
581
- if (that.iLength < iStartIndex + oData.results.length) {
582
- that.iLength = iStartIndex + oData.results.length;
583
- that.bLengthFinal = false;
584
- }
650
+ // if we got data and the results + startindex is larger than the
651
+ // length we just apply this value to the length
652
+ if (that.iLength < iStartIndex + oData.results.length) {
653
+ that.iLength = iStartIndex + oData.results.length;
654
+ that.bLengthFinal = false;
655
+ }
585
656
 
586
- // if less entries are returned than have been requested
587
- // set length accordingly
588
- if (!oData.__next && (oData.results.length < iLength || iLength === undefined)) {
589
- that.iLength = iStartIndex + oData.results.length;
590
- that.bLengthFinal = true;
591
- }
592
- } else {
593
- // In fault tolerance mode, if an empty array and next link is returned,
594
- // finalize the length accordingly
595
- if (that.bFaultTolerant && oData.__next) {
596
- that.iLength = iStartIndex;
597
- that.bLengthFinal = true;
598
- }
657
+ // if less entries are returned than have been requested set length accordingly
658
+ if (!oData.__next && (oData.results.length < iLength || iLength === undefined)) {
659
+ that.iLength = iStartIndex + oData.results.length;
660
+ that.bLengthFinal = true;
661
+ }
662
+ } else {
663
+ // In fault tolerance mode, if an empty array and next link is returned,
664
+ // finalize the length accordingly
665
+ if (that.bFaultTolerant && oData.__next) {
666
+ that.iLength = iStartIndex;
667
+ that.bLengthFinal = true;
668
+ }
599
669
 
600
- // check if there are any results at all...
601
- if (iStartIndex === 0) {
602
- that.iLength = 0;
603
- that.aKeys = [];
604
- that.bLengthFinal = true;
605
- }
670
+ // check if there are any results at all...
671
+ if (iStartIndex === 0) {
672
+ that.iLength = 0;
673
+ that.aKeys = [];
674
+ that.bLengthFinal = true;
675
+ }
606
676
 
607
- // if next requested page has no results, and startindex = actual length
608
- // we could set lengthFinal true as we know the length.
609
- if (iStartIndex === that.iLength) {
610
- that.bLengthFinal = true;
611
- }
677
+ // if next requested page has no results, and startindex = actual length
678
+ // we could set lengthFinal true as we know the length.
679
+ if (iStartIndex === that.iLength) {
680
+ that.bLengthFinal = true;
612
681
  }
613
682
  }
614
683
 
@@ -651,8 +720,6 @@ sap.ui.define([
651
720
 
652
721
  }
653
722
 
654
- var sPath = this.sPath;
655
-
656
723
  if (this.isRelative()){
657
724
  sPath = this.getResolvedPath();
658
725
  }
@@ -713,21 +780,15 @@ sap.ui.define([
713
780
  * @private
714
781
  */
715
782
  ODataListBinding.prototype._getLength = function() {
716
- var that = this;
717
- var sGroupId;
783
+ var sGroupId, sPath,
784
+ aParams = [],
785
+ that = this;
718
786
 
719
787
  if (this.sCountMode !== CountMode.Request && this.sCountMode !== CountMode.Both) {
720
788
  return;
721
789
  }
722
790
 
723
- // create a request object for the data request
724
- // In OperationMode.Auto we explicitly omitt the filters for the count,
725
- // filters will be applied afterwards on the client if count comes under the threshold
726
- var aParams = [];
727
- if (this.sFilterParams && this.sOperationMode != OperationMode.Auto) {
728
- aParams.push(this.sFilterParams);
729
- }
730
-
791
+ this._addFilterQueryOption(aParams, this.sOperationMode !== OperationMode.Auto);
731
792
  // use only custom params for count and not expand,select params
732
793
  if (this.mParameters && this.mParameters.custom) {
733
794
  var oCust = { custom: {}};
@@ -765,7 +826,7 @@ sap.ui.define([
765
826
  }
766
827
 
767
828
  // Use context and check for relative binding
768
- var sPath = this.getResolvedPath();
829
+ sPath = this.getResolvedPath();
769
830
 
770
831
  // Only send request, if path is defined
771
832
  if (sPath) {
@@ -809,6 +870,10 @@ sap.ui.define([
809
870
  * To update a control, even if no data has been changed, e.g. to reset a control after failed
810
871
  * validation, use the parameter <code>bForceUpdate</code>.
811
872
  *
873
+ * Entities that have been created via {@link #create} and saved in the back end are removed
874
+ * from the creation rows area and inserted at the right position based on the current filters
875
+ * and sorters.
876
+ *
812
877
  * @param {boolean} [bForceUpdate] Update the bound control even if no data has been changed
813
878
  * @param {string} [sGroupId] The group Id for the refresh
814
879
  *
@@ -819,12 +884,19 @@ sap.ui.define([
819
884
  sGroupId = bForceUpdate;
820
885
  bForceUpdate = false;
821
886
  }
887
+ this._removePersistedCreatedContexts();
822
888
  this.sRefreshGroupId = sGroupId;
823
889
  this._refresh(bForceUpdate);
824
890
  this.sRefreshGroupId = undefined;
825
891
  };
826
892
 
827
893
  /**
894
+ * Refreshes the binding.
895
+ *
896
+ * @param {boolean} bForceUpdate Whether an update should be forced
897
+ * @param {object} [mChangedEntities] A map of changed entities
898
+ * @param {object} [mEntityTypes] A map of entity types
899
+ *
828
900
  * @private
829
901
  */
830
902
  ODataListBinding.prototype._refresh = function(bForceUpdate, mChangedEntities, mEntityTypes) {
@@ -854,6 +926,8 @@ sap.ui.define([
854
926
 
855
927
  return false;
856
928
  }
929
+
930
+ return true;
857
931
  });
858
932
  }
859
933
  if (!mChangedEntities && !mEntityTypes) { // default
@@ -1047,6 +1121,8 @@ sap.ui.define([
1047
1121
  bChangeDetected = true;
1048
1122
  return false;
1049
1123
  }
1124
+
1125
+ return true;
1050
1126
  });
1051
1127
  }
1052
1128
  }
@@ -1131,17 +1207,22 @@ sap.ui.define([
1131
1207
 
1132
1208
  sPath = this.getResolvedPath();
1133
1209
 
1134
- if (sPath) {
1135
- return this.oModel._createRequestUrl(sPath, null, aParams);
1136
- }
1210
+ return sPath && this.oModel._createRequestUrl(sPath, null, aParams);
1137
1211
  };
1138
1212
 
1139
1213
  /**
1140
1214
  * Sorts the list.
1141
1215
  *
1142
- * @param {sap.ui.model.Sorter|sap.ui.model.Sorter[]} aSorters A new sorter or an array of sorters which define the sort order
1143
- * @param {boolean} [bReturnSuccess=false] Whether the success indicator should be returned instead of <code>this</code>
1144
- * @return {this} Reference to <code>this</code> to facilitate method chaining or the success indicator
1216
+ * Entities that have been created via {@link #create} and saved in the back end are removed
1217
+ * from the creation rows area and inserted at the right position based on the current filters
1218
+ * and sorters.
1219
+ *
1220
+ * @param {sap.ui.model.Sorter|sap.ui.model.Sorter[]} aSorters
1221
+ * A new sorter or an array of sorters which define the sort order
1222
+ * @param {boolean} [bReturnSuccess=false]
1223
+ * Whether the success indicator should be returned instead of <code>this</code>
1224
+ * @return {this}
1225
+ * Reference to <code>this</code> to facilitate method chaining or the success indicator
1145
1226
  * @public
1146
1227
  */
1147
1228
  ODataListBinding.prototype.sort = function(aSorters, bReturnSuccess) {
@@ -1180,13 +1261,17 @@ sap.ui.define([
1180
1261
  this.sChangeReason = ChangeReason.Sort;
1181
1262
  }
1182
1263
  } else {
1264
+ // when removing the persisted created entries from the cache we break the invariant
1265
+ // that the number of entries (read from server) does not change when sorting. So
1266
+ // we need to update the length we received from the server
1267
+ this.iLength += this._removePersistedCreatedContexts().length;
1183
1268
  // Only reset the keys, length usually doesn't change when sorting
1269
+ // therefore #resetData is not required
1184
1270
  this.aKeys = [];
1185
1271
  this.abortPendingRequest(false);
1186
1272
  this.sChangeReason = ChangeReason.Sort;
1187
1273
  this._fireRefresh({reason : this.sChangeReason});
1188
1274
  }
1189
- // TODO remove this if the sort event gets removed which is now deprecated
1190
1275
  this._fireSort({sorter: aSorters});
1191
1276
  bSuccess = true;
1192
1277
  }
@@ -1199,9 +1284,15 @@ sap.ui.define([
1199
1284
  };
1200
1285
 
1201
1286
  /**
1202
- * Sets the comparator for each sorter/filter in the array according to the
1203
- * Edm type of the sort/filter property.
1204
- * @param bSort Whether a comparator usable for sorting should be returned, where comparison with null returns a valid result.
1287
+ * Sets the comparator for each sorter/filter in the array according to the Edm type of the
1288
+ * sort/filter property.
1289
+ *
1290
+ * @param {object[]} aEntries
1291
+ * Array of sorters/filters
1292
+ * @param {boolean} bSort
1293
+ * Whether a comparator usable for sorting should be returned, where comparison with null
1294
+ * returns a valid result
1295
+ *
1205
1296
  * @private
1206
1297
  */
1207
1298
  ODataListBinding.prototype.addComparators = function(aEntries, bSort) {
@@ -1235,9 +1326,13 @@ sap.ui.define([
1235
1326
  /**
1236
1327
  * Creates a comparator usable for sorting.
1237
1328
  *
1238
- * The OData comparators return "NaN" for comparisons containing null values. While this is a valid result when used for filtering,
1239
- * for sorting the null values need to be put in order, so the comparator must return either -1 or 1 instead, to have null sorted
1240
- * at the top in ascending order and on the bottom in descending order.
1329
+ * The OData comparators return "NaN" for comparisons containing null values. While this is a
1330
+ * valid result when used for filtering, for sorting the null values need to be put in order, so
1331
+ * the comparator must return either -1 or 1 instead, to have null sorted at the top in
1332
+ * ascending order and on the bottom in descending order.
1333
+ *
1334
+ * @param {function} fnCompare Function to compare two values with
1335
+ * @returns {function} The sort comparator
1241
1336
  *
1242
1337
  * @private
1243
1338
  */
@@ -1257,8 +1352,13 @@ sap.ui.define([
1257
1352
  }
1258
1353
 
1259
1354
  /**
1260
- * Does normalize the filter values according to the given Edm type. This is necessary for comparators
1261
- * to work as expected, even if the wrong JavaScript type is passed to the filter (string vs number)
1355
+ * Does normalize the filter values according to the given Edm type. This is necessary for
1356
+ * comparators to work as expected, even if the wrong JavaScript type is passed to the filter
1357
+ * (string vs number).
1358
+ *
1359
+ * @param {string} sType The Edm type
1360
+ * @param {object} oFilter The filter
1361
+ *
1262
1362
  * @private
1263
1363
  */
1264
1364
  function normalizeFilterValues(sType, oFilter) {
@@ -1323,6 +1423,10 @@ sap.ui.define([
1323
1423
  * are combined with OR, while filters on different table columns are combined with AND.
1324
1424
  * Please note that a custom filter function is only supported with operation mode <code>sap.ui.model.odata.OperationMode.Client</code>.
1325
1425
  *
1426
+ * Entities that have been created via {@link #create} and saved in the back end are removed
1427
+ * from the creation rows area and inserted at the right position based on the current filters
1428
+ * and sorters.
1429
+ *
1326
1430
  * @param {sap.ui.model.Filter|sap.ui.model.Filter[]} aFilters Single filter or array of filter objects
1327
1431
  * @param {sap.ui.model.FilterType} [sFilterType=Control] Type of the filter which should be adjusted. If it is not given, type <code>Control</code> is assumed
1328
1432
  * @param {boolean} [bReturnSuccess=false] Whether the success indicator should be returned instead of <code>this</code>
@@ -1381,12 +1485,12 @@ sap.ui.define([
1381
1485
  this.sChangeReason = ChangeReason.Filter;
1382
1486
  }
1383
1487
  } else {
1488
+ this._removePersistedCreatedContexts();
1384
1489
  this.resetData();
1385
1490
  this.abortPendingRequest(true);
1386
1491
  this.sChangeReason = ChangeReason.Filter;
1387
1492
  this._fireRefresh({reason: this.sChangeReason});
1388
1493
  }
1389
- // TODO remove this if the filter event gets removed which is now deprecated
1390
1494
  if (sFilterType === FilterType.Application) {
1391
1495
  this._fireFilter({filters: this.aApplicationFilters});
1392
1496
  } else {
@@ -1717,5 +1821,18 @@ sap.ui.define([
1717
1821
  };
1718
1822
  };
1719
1823
 
1824
+ /**
1825
+ * Removes and returns the persisted created entities for this binding.
1826
+ *
1827
+ * @returns {sap.ui.model.odata.v2.Context[]}
1828
+ * An array of persisted contexts that have been removed from the created contexts cache
1829
+ *
1830
+ * @private
1831
+ */
1832
+ ODataListBinding.prototype._removePersistedCreatedContexts = function () {
1833
+ return this.oModel._getCreatedContextsCache()
1834
+ .removePersistedContexts(this.getResolvedPath(), this.sCreatedEntitiesKey);
1835
+ };
1836
+
1720
1837
  return ODataListBinding;
1721
1838
  });