@openui5/sap.ui.core 1.104.0 → 1.105.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.
- package/.reuse/dep5 +1 -1
- package/THIRDPARTY.txt +1 -1
- package/package.json +1 -1
- package/src/jquery.sap.global.js +1 -1
- package/src/jquery.sap.properties.js +1 -1
- package/src/jquery.sap.resources.js +1 -1
- package/src/jquery.sap.script.js +1 -1
- package/src/jquery.sap.storage.js +3 -3
- package/src/sap/base/util/fetch.js +3 -0
- package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
- package/src/sap/base/util/restricted/_castArray.js +1 -1
- package/src/sap/base/util/restricted/_compact.js +1 -1
- package/src/sap/base/util/restricted/_curry.js +1 -1
- package/src/sap/base/util/restricted/_debounce.js +1 -1
- package/src/sap/base/util/restricted/_difference.js +1 -1
- package/src/sap/base/util/restricted/_differenceBy.js +1 -1
- package/src/sap/base/util/restricted/_differenceWith.js +1 -1
- package/src/sap/base/util/restricted/_flatMap.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
- package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
- package/src/sap/base/util/restricted/_flatten.js +1 -1
- package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
- package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
- package/src/sap/base/util/restricted/_intersection.js +1 -1
- package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
- package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
- package/src/sap/base/util/restricted/_isEqual.js +1 -1
- package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
- package/src/sap/base/util/restricted/_isNil.js +1 -1
- package/src/sap/base/util/restricted/_max.js +1 -1
- package/src/sap/base/util/restricted/_merge.js +1 -1
- package/src/sap/base/util/restricted/_mergeWith.js +1 -1
- package/src/sap/base/util/restricted/_min.js +1 -1
- package/src/sap/base/util/restricted/_omit.js +1 -1
- package/src/sap/base/util/restricted/_pick.js +1 -1
- package/src/sap/base/util/restricted/_pickBy.js +1 -1
- package/src/sap/base/util/restricted/_throttle.js +1 -1
- package/src/sap/base/util/restricted/_toArray.js +1 -1
- package/src/sap/base/util/restricted/_union.js +1 -1
- package/src/sap/base/util/restricted/_unionBy.js +1 -1
- package/src/sap/base/util/restricted/_unionWith.js +1 -1
- package/src/sap/base/util/restricted/_uniq.js +1 -1
- package/src/sap/base/util/restricted/_uniqBy.js +1 -1
- package/src/sap/base/util/restricted/_uniqWith.js +1 -1
- package/src/sap/base/util/restricted/_without.js +1 -1
- package/src/sap/base/util/restricted/_xor.js +1 -1
- package/src/sap/base/util/restricted/_xorBy.js +1 -1
- package/src/sap/base/util/restricted/_xorWith.js +1 -1
- package/src/sap/base/util/restricted/_zipObject.js +1 -1
- package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
- package/src/sap/ui/Device.js +5 -5
- package/src/sap/ui/Global.js +4 -4
- package/src/sap/ui/base/Event.js +1 -1
- package/src/sap/ui/base/EventProvider.js +1 -1
- package/src/sap/ui/base/Interface.js +1 -1
- package/src/sap/ui/base/ManagedObject.js +1 -1
- package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
- package/src/sap/ui/base/ManagedObjectObserver.js +2 -2
- package/src/sap/ui/base/Metadata.js +1 -1
- package/src/sap/ui/base/Object.js +1 -1
- package/src/sap/ui/base/ObjectPool.js +1 -1
- package/src/sap/ui/core/.library +54 -51
- package/src/sap/ui/core/AccessKeysEnablement.js +173 -0
- package/src/sap/ui/core/BusyIndicator.js +1 -1
- package/src/sap/ui/core/Component.js +1 -1
- package/src/sap/ui/core/ComponentContainer.js +1 -1
- package/src/sap/ui/core/ComponentMetadata.js +11 -11
- package/src/sap/ui/core/ComponentSupport.js +1 -1
- package/src/sap/ui/core/Configuration.js +33 -5
- package/src/sap/ui/core/Control.js +1 -1
- package/src/sap/ui/core/Core.js +1 -1
- package/src/sap/ui/core/CustomData.js +1 -1
- package/src/sap/ui/core/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/Element.js +1 -1
- package/src/sap/ui/core/ElementMetadata.js +6 -4
- package/src/sap/ui/core/EnabledPropagator.js +1 -1
- package/src/sap/ui/core/EventBus.js +1 -1
- package/src/sap/ui/core/ExtensionPoint.js +2 -2
- package/src/sap/ui/core/Fragment.js +1 -1
- package/src/sap/ui/core/HTML.js +1 -1
- package/src/sap/ui/core/History.js +1 -1
- package/src/sap/ui/core/Icon.js +1 -1
- package/src/sap/ui/core/IndicationColorSupport.js +1 -1
- package/src/sap/ui/core/IntervalTrigger.js +1 -1
- package/src/sap/ui/core/InvisibleMessage.js +1 -1
- package/src/sap/ui/core/InvisibleRenderer.js +1 -1
- package/src/sap/ui/core/InvisibleText.js +1 -1
- package/src/sap/ui/core/Item.js +1 -1
- package/src/sap/ui/core/LabelEnablement.js +1 -1
- package/src/sap/ui/core/LayoutData.js +1 -1
- package/src/sap/ui/core/ListItem.js +1 -1
- package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
- package/src/sap/ui/core/Locale.js +1 -1
- package/src/sap/ui/core/LocaleData.js +2 -3
- package/src/sap/ui/core/Manifest.js +3 -5
- package/src/sap/ui/core/Message.js +1 -1
- package/src/sap/ui/core/Popup.js +12 -7
- package/src/sap/ui/core/RenderManager.js +1 -1
- package/src/sap/ui/core/Renderer.js +1 -1
- package/src/sap/ui/core/ResizeHandler.js +1 -1
- package/src/sap/ui/core/ScrollBar.js +1 -1
- package/src/sap/ui/core/SeparatorItem.js +1 -1
- package/src/sap/ui/core/Title.js +1 -1
- package/src/sap/ui/core/TooltipBase.js +1 -1
- package/src/sap/ui/core/UIArea.js +1 -1
- package/src/sap/ui/core/UIComponent.js +1 -1
- package/src/sap/ui/core/UIComponentMetadata.js +1 -1
- package/src/sap/ui/core/ValueStateSupport.js +1 -1
- package/src/sap/ui/core/VariantLayoutData.js +1 -1
- package/src/sap/ui/core/XMLComposite.js +4 -1
- package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
- package/src/sap/ui/core/_IconRegistry.js +1 -1
- package/src/sap/ui/core/date/Buddhist.js +4 -4
- package/src/sap/ui/core/date/UniversalDate.js +144 -34
- package/src/sap/ui/core/delegate/ItemNavigation.js +2 -2
- package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
- package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
- package/src/sap/ui/core/dnd/DragDropInfo.js +3 -3
- package/src/sap/ui/core/dnd/DragInfo.js +1 -1
- package/src/sap/ui/core/dnd/DropInfo.js +1 -1
- package/src/sap/ui/core/format/DateFormat.js +31 -9
- package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
- package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
- package/src/sap/ui/core/library.js +44 -3
- package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
- package/src/sap/ui/core/message/Message.js +1 -1
- package/src/sap/ui/core/message/MessageManager.js +1 -1
- package/src/sap/ui/core/message/MessageParser.js +1 -1
- package/src/sap/ui/core/message/MessageProcessor.js +1 -1
- package/src/sap/ui/core/messagebundle.properties +2 -0
- package/src/sap/ui/core/messagebundle_cy.properties +1 -1
- package/src/sap/ui/core/messagebundle_el.properties +1 -1
- package/src/sap/ui/core/messagebundle_en.properties +57 -56
- package/src/sap/ui/core/messagebundle_en_GB.properties +57 -56
- package/src/sap/ui/core/messagebundle_fr.properties +1 -1
- package/src/sap/ui/core/messagebundle_fr_CA.properties +1 -1
- package/src/sap/ui/core/messagebundle_hi.properties +1 -1
- package/src/sap/ui/core/messagebundle_hu.properties +1 -1
- package/src/sap/ui/core/messagebundle_ko.properties +4 -4
- package/src/sap/ui/core/messagebundle_sh.properties +1 -1
- package/src/sap/ui/core/messagebundle_vi.properties +1 -1
- package/src/sap/ui/core/mvc/Controller.js +12 -12
- package/src/sap/ui/core/mvc/HTMLView.js +1 -1
- package/src/sap/ui/core/mvc/JSONView.js +1 -1
- package/src/sap/ui/core/mvc/JSView.js +1 -1
- package/src/sap/ui/core/mvc/TemplateView.js +1 -1
- package/src/sap/ui/core/mvc/View.js +7 -7
- package/src/sap/ui/core/mvc/XMLView.js +1 -1
- package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
- package/src/sap/ui/core/plugin/LessSupport.js +1 -1
- package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
- package/src/sap/ui/core/postmessage/Bus.js +1 -1
- package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
- package/src/sap/ui/core/routing/Router.js +3 -3
- package/src/sap/ui/core/search/OpenSearchProvider.js +2 -2
- package/src/sap/ui/core/search/SearchProvider.js +2 -2
- package/src/sap/ui/core/service/Service.js +1 -1
- package/src/sap/ui/core/service/ServiceFactory.js +1 -1
- package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
- package/src/sap/ui/core/support/Plugin.js +1 -1
- package/src/sap/ui/core/support/Support.js +2 -3
- package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
- package/src/sap/ui/core/support/plugins/Debugging.js +1 -1
- package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
- package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
- package/src/sap/ui/core/support/plugins/Performance.js +1 -1
- package/src/sap/ui/core/support/plugins/Selector.js +1 -1
- package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
- package/src/sap/ui/core/support/plugins/Trace.js +1 -1
- package/src/sap/ui/core/support/plugins/ViewInfo.js +2 -3
- package/src/sap/ui/core/themes/base/Icon.less +4 -0
- package/src/sap/ui/core/themes/base/global.less +5 -1
- package/src/sap/ui/core/themes/base/shared.less +6 -0
- package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
- package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
- package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
- package/src/sap/ui/core/tmpl/Template.js +1 -1
- package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
- package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
- package/src/sap/ui/core/util/Export.js +1 -1
- package/src/sap/ui/core/util/ExportCell.js +1 -1
- package/src/sap/ui/core/util/ExportColumn.js +1 -1
- package/src/sap/ui/core/util/ExportRow.js +1 -1
- package/src/sap/ui/core/util/ExportType.js +1 -1
- package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
- package/src/sap/ui/core/util/File.js +1 -1
- package/src/sap/ui/core/util/LibraryInfo.js +1 -1
- package/src/sap/ui/core/util/MockServer.js +1 -1
- package/src/sap/ui/core/util/PasteHelper.js +1 -1
- package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +0 -3
- package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
- package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
- package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
- package/src/sap/ui/core/ws/ReadyState.js +1 -1
- package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
- package/src/sap/ui/core/ws/WebSocket.js +1 -1
- package/src/sap/ui/debug/ControlTree.js +1 -1
- package/src/sap/ui/debug/DebugEnv.js +1 -1
- package/src/sap/ui/debug/PropertyList.js +1 -1
- package/src/sap/ui/model/ClientModel.js +1 -1
- package/src/sap/ui/model/CompositeDataState.js +1 -1
- package/src/sap/ui/model/CompositeType.js +1 -1
- package/src/sap/ui/model/DataState.js +1 -1
- package/src/sap/ui/model/MetaModel.js +1 -1
- package/src/sap/ui/model/Model.js +1 -1
- package/src/sap/ui/model/SelectionModel.js +1 -1
- package/src/sap/ui/model/SimpleType.js +1 -1
- package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
- package/src/sap/ui/model/Type.js +1 -1
- package/src/sap/ui/model/_Helper.js +3 -1
- package/src/sap/ui/model/base/ManagedObjectModel.js +2 -2
- package/src/sap/ui/model/json/JSONModel.js +1 -1
- package/src/sap/ui/model/message/MessageModel.js +1 -1
- package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/ODataMessageParser.js +4 -4
- package/src/sap/ui/model/odata/ODataMetaModel.js +31 -8
- package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
- package/src/sap/ui/model/odata/ODataModel.js +1 -1
- package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +332 -182
- package/src/sap/ui/model/odata/type/Boolean.js +1 -1
- package/src/sap/ui/model/odata/type/Byte.js +1 -1
- package/src/sap/ui/model/odata/type/Currency.js +1 -1
- package/src/sap/ui/model/odata/type/Date.js +1 -1
- package/src/sap/ui/model/odata/type/DateTime.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
- package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
- package/src/sap/ui/model/odata/type/Decimal.js +1 -1
- package/src/sap/ui/model/odata/type/Double.js +1 -1
- package/src/sap/ui/model/odata/type/Guid.js +1 -1
- package/src/sap/ui/model/odata/type/Int.js +1 -1
- package/src/sap/ui/model/odata/type/Int16.js +1 -1
- package/src/sap/ui/model/odata/type/Int32.js +1 -1
- package/src/sap/ui/model/odata/type/Int64.js +1 -1
- package/src/sap/ui/model/odata/type/ODataType.js +1 -1
- package/src/sap/ui/model/odata/type/Raw.js +1 -1
- package/src/sap/ui/model/odata/type/SByte.js +1 -1
- package/src/sap/ui/model/odata/type/Single.js +1 -1
- package/src/sap/ui/model/odata/type/Stream.js +1 -1
- package/src/sap/ui/model/odata/type/String.js +1 -1
- package/src/sap/ui/model/odata/type/Time.js +1 -1
- package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
- package/src/sap/ui/model/odata/type/Unit.js +1 -1
- package/src/sap/ui/model/odata/v2/Context.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
- package/src/sap/ui/model/odata/v2/ODataListBinding.js +25 -0
- package/src/sap/ui/model/odata/v2/ODataModel.js +50 -19
- package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +4 -1
- package/src/sap/ui/model/odata/v4/Context.js +84 -30
- package/src/sap/ui/model/odata/v4/ODataBinding.js +8 -8
- package/src/sap/ui/model/odata/v4/ODataContextBinding.js +26 -27
- package/src/sap/ui/model/odata/v4/ODataListBinding.js +217 -133
- package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
- package/src/sap/ui/model/odata/v4/ODataModel.js +3 -2
- package/src/sap/ui/model/odata/v4/ODataParentBinding.js +10 -13
- package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +4 -4
- package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +135 -28
- package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +133 -16
- package/src/sap/ui/model/odata/v4/lib/_Cache.js +278 -143
- package/src/sap/ui/model/odata/v4/lib/_Helper.js +31 -9
- package/src/sap/ui/model/odata/v4/lib/_Requestor.js +5 -5
- package/src/sap/ui/model/resource/ResourceModel.js +1 -1
- package/src/sap/ui/model/type/Boolean.js +1 -1
- package/src/sap/ui/model/type/Currency.js +1 -1
- package/src/sap/ui/model/type/Date.js +1 -1
- package/src/sap/ui/model/type/DateInterval.js +1 -1
- package/src/sap/ui/model/type/DateTime.js +1 -1
- package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
- package/src/sap/ui/model/type/FileSize.js +1 -1
- package/src/sap/ui/model/type/Float.js +1 -1
- package/src/sap/ui/model/type/Integer.js +1 -1
- package/src/sap/ui/model/type/String.js +1 -1
- package/src/sap/ui/model/type/Time.js +1 -1
- package/src/sap/ui/model/type/TimeInterval.js +1 -1
- package/src/sap/ui/model/type/Unit.js +1 -1
- package/src/sap/ui/model/xml/XMLModel.js +4 -2
- package/src/sap/ui/performance/trace/FESR.js +27 -24
- package/src/sap/ui/performance/trace/Interaction.js +66 -16
- package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
- package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
- package/src/sap/ui/test/actions/Press.js +7 -0
- package/src/sap/ui/test/generic/TestBase.js +1 -1
- package/src/sap/ui/test/matchers/AggregationContainsPropertyEqual.js +2 -3
- package/src/sap/ui/test/matchers/AggregationFilled.js +2 -3
- package/src/sap/ui/test/matchers/AggregationLengthEquals.js +2 -3
- package/src/sap/ui/test/opaQunit.js +11 -6
- package/src/sap/ui/test/pipelines/ActionPipeline.js +2 -3
- package/src/sap/ui/test/pipelines/MatcherPipeline.js +2 -3
- package/src/sap/ui/test/pipelines/PipelineFactory.js +2 -3
- package/src/sap/ui/util/Storage.js +1 -1
|
@@ -42,7 +42,7 @@ sap.ui.define([
|
|
|
42
42
|
* @hideconstructor
|
|
43
43
|
* @public
|
|
44
44
|
* @since 1.39.0
|
|
45
|
-
* @version 1.
|
|
45
|
+
* @version 1.105.1
|
|
46
46
|
*/
|
|
47
47
|
Context = BaseContext.extend("sap.ui.model.odata.v4.Context", {
|
|
48
48
|
constructor : constructor
|
|
@@ -126,6 +126,7 @@ sap.ui.define([
|
|
|
126
126
|
// ensure to return a promise that is resolved w/o data
|
|
127
127
|
&& Promise.resolve(oCreatePromise).then(function () {});
|
|
128
128
|
this.oSyncCreatePromise = oCreatePromise;
|
|
129
|
+
this.bDeleted = false; // deleted on the client, but not on the server yet
|
|
129
130
|
this.iGeneration = iGeneration || 0;
|
|
130
131
|
this.bInactive = bInactive || undefined; // be in sync with the annotation
|
|
131
132
|
this.iIndex = iIndex;
|
|
@@ -276,16 +277,27 @@ sap.ui.define([
|
|
|
276
277
|
};
|
|
277
278
|
|
|
278
279
|
/**
|
|
279
|
-
* Deletes the OData entity this context points to.
|
|
280
|
+
* Deletes the OData entity this context points to. The context is removed from the binding
|
|
281
|
+
* immediately, even if {@link sap.ui.model.odata.v4.SubmitMode.API} is used, and the request is
|
|
282
|
+
* only sent later when {@link sap.ui.model.odata.v4.ODataModel#submitBatch} is called. As long
|
|
283
|
+
* as the context is deleted on the client, but not yet on the server, {@link #isDeleted}
|
|
284
|
+
* returns <code>true</code>.
|
|
285
|
+
*
|
|
286
|
+
* Since 1.105 such a pending deletion is a pending change. It causes
|
|
287
|
+
* <code>hasPendingChanges</code> to return <code>true</code> for the context, the binding
|
|
288
|
+
* containing it, and the model. <code>resetChanges</code> in binding or model cancels the
|
|
289
|
+
* deletion and restores the context.
|
|
290
|
+
*
|
|
291
|
+
* The usage of a group ID with {@link sap.ui.model.odata.v4.SubmitMode.API} is possible since
|
|
292
|
+
* 1.105 - this is an experimental API.
|
|
280
293
|
*
|
|
281
294
|
* The context must not be used anymore after successful deletion.
|
|
282
295
|
*
|
|
283
296
|
* @param {string} [sGroupId]
|
|
284
297
|
* The group ID to be used for the DELETE request; if not specified, the update group ID for
|
|
285
|
-
* the context's binding is used, see {@link #getUpdateGroupId}
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* can use <code>null</code> to prevent the DELETE request in case of a kept-alive context
|
|
298
|
+
* the context's binding is used, see {@link #getUpdateGroupId}. Since 1.81, if this context
|
|
299
|
+
* is transient (see {@link #isTransient}), no group ID needs to be specified. Since 1.98.0,
|
|
300
|
+
* you can use <code>null</code> to prevent the DELETE request in case of a kept-alive context
|
|
289
301
|
* that is not in the collection and of which you know that it does not exist on the server
|
|
290
302
|
* anymore (for example, a draft after activation).
|
|
291
303
|
* @param {boolean} [bDoNotRequestCount]
|
|
@@ -294,24 +306,40 @@ sap.ui.define([
|
|
|
294
306
|
* Since 1.98.0, this is implied if a <code>null</code> group ID is used.
|
|
295
307
|
* @returns {Promise}
|
|
296
308
|
* A promise which is resolved without a result in case of success, or rejected with an
|
|
297
|
-
* instance of <code>Error</code> in case of failure,
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
309
|
+
* instance of <code>Error</code> in case of failure, for example if:
|
|
310
|
+
* <ul>
|
|
311
|
+
* <li> the given context does not point to an entity,
|
|
312
|
+
* <li> the deletion on the server fails,
|
|
313
|
+
* <li> the deletion is canceled via <code>resetChanges</code> (in this case the error
|
|
314
|
+
* instance has the property <code>canceled</code> with value <code>true</code>).
|
|
315
|
+
* </ul>
|
|
316
|
+
* The error instance has the property <code>isConcurrentModification</code> with value
|
|
317
|
+
* <code>true</code> in case a concurrent modification (e.g. by another user) of the entity
|
|
318
|
+
* between loading and deletion has been detected; this should be shown to the user who needs
|
|
319
|
+
* to decide whether to try deletion again. If the entity does not exist, we assume it has
|
|
320
|
+
* already been deleted by someone else and report success.
|
|
321
|
+
* @throws {Error} If
|
|
322
|
+
* <ul>
|
|
323
|
+
* <li> the given group ID is invalid,
|
|
324
|
+
* <li> this context's root binding is suspended,
|
|
325
|
+
* <li> a <code>null</code> group ID is used with a context which is not kept-alive
|
|
326
|
+
* (see {@link #isKeepAlive}),
|
|
327
|
+
* <li> the context is already being deleted,
|
|
328
|
+
* <li> the resulting group ID has {@link sap.ui.model.odata.v4.SubmitMode.API}, and the
|
|
329
|
+
* context is kept alive (see {@link #isKeepAlive}), but not in the current collection,
|
|
330
|
+
* <li> (only before 1.105) the resulting group ID has
|
|
331
|
+
* {@link sap.ui.model.odata.v4.SubmitMode.API}
|
|
332
|
+
* </ul>
|
|
312
333
|
*
|
|
313
334
|
* @function
|
|
314
335
|
* @public
|
|
336
|
+
* @see {#hasPendingChanges}
|
|
337
|
+
* @see {sap.ui.model.odata.v4.ODataContextBinding#hasPendingChanges}
|
|
338
|
+
* @see {sap.ui.model.odata.v4.ODataListBinding#hasPendingChanges}
|
|
339
|
+
* @see {sap.ui.model.odata.v4.ODataModel#hasPendingChanges}
|
|
340
|
+
* @see {sap.ui.model.odata.v4.ODataContextBinding#resetChanges}
|
|
341
|
+
* @see {sap.ui.model.odata.v4.ODataListBinding#resetChanges}
|
|
342
|
+
* @see {sap.ui.model.odata.v4.ODataModel#resetChanges}
|
|
315
343
|
* @since 1.41.0
|
|
316
344
|
*/
|
|
317
345
|
Context.prototype.delete = function (sGroupId, bDoNotRequestCount/*, bRejectIfNotFound*/) {
|
|
@@ -319,11 +347,12 @@ sap.ui.define([
|
|
|
319
347
|
oModel = this.oModel,
|
|
320
348
|
that = this;
|
|
321
349
|
|
|
350
|
+
if (this.isDeleted()) {
|
|
351
|
+
throw new Error("Must not delete twice: " + this);
|
|
352
|
+
}
|
|
322
353
|
this.oBinding.checkSuspended();
|
|
323
354
|
if (this.isTransient()) {
|
|
324
355
|
sGroupId = null;
|
|
325
|
-
} else if (this.hasPendingChanges()) {
|
|
326
|
-
throw new Error("Cannot delete due to pending changes");
|
|
327
356
|
} else if (sGroupId === null) {
|
|
328
357
|
if (!(this.bKeepAlive && this.iIndex === undefined)) {
|
|
329
358
|
throw new Error("Cannot delete " + this);
|
|
@@ -334,15 +363,15 @@ sap.ui.define([
|
|
|
334
363
|
} else {
|
|
335
364
|
oModel.checkGroupId(sGroupId);
|
|
336
365
|
oGroupLock = this.oBinding.lockGroup(sGroupId, true, true);
|
|
337
|
-
sGroupId = oGroupLock.getGroupId();
|
|
338
|
-
if (this.oModel.isApiGroup(sGroupId)) {
|
|
339
|
-
throw new Error("Illegal update group ID: " + sGroupId);
|
|
340
|
-
}
|
|
341
366
|
}
|
|
342
367
|
|
|
343
|
-
|
|
368
|
+
this.bDeleted = true;
|
|
369
|
+
|
|
370
|
+
return Promise.resolve(this._delete(oGroupLock, /*oETagEntity*/null, bDoNotRequestCount))
|
|
371
|
+
.then(function () {
|
|
344
372
|
var sResourcePathPrefix = that.sPath.slice(1);
|
|
345
373
|
|
|
374
|
+
that.bDeleted = false;
|
|
346
375
|
// Messages have been updated via _Cache#_delete; "that" is already destroyed; remove
|
|
347
376
|
// all dependent caches in all bindings
|
|
348
377
|
oModel.getAllBindings().forEach(function (oBinding) {
|
|
@@ -353,6 +382,8 @@ sap.ui.define([
|
|
|
353
382
|
oGroupLock.unlock(true);
|
|
354
383
|
}
|
|
355
384
|
oModel.reportError("Failed to delete " + that, sClassName, oError);
|
|
385
|
+
that.bDeleted = false;
|
|
386
|
+
that.checkUpdate();
|
|
356
387
|
throw oError;
|
|
357
388
|
});
|
|
358
389
|
};
|
|
@@ -405,6 +436,7 @@ sap.ui.define([
|
|
|
405
436
|
* A promise which is resolved without a result in case of success, or rejected with an
|
|
406
437
|
* instance of <code>Error</code> in case of failure, for example if the annotation belongs to
|
|
407
438
|
* the read-only namespace "@$ui5.*"
|
|
439
|
+
* @throws {Error} If the context is deleted
|
|
408
440
|
*
|
|
409
441
|
* @private
|
|
410
442
|
*/
|
|
@@ -414,6 +446,12 @@ sap.ui.define([
|
|
|
414
446
|
oValue,
|
|
415
447
|
that = this;
|
|
416
448
|
|
|
449
|
+
if (this.isDeleted()) {
|
|
450
|
+
if (oGroupLock) {
|
|
451
|
+
oGroupLock.unlock();
|
|
452
|
+
}
|
|
453
|
+
throw new Error("must not modify a deleted entity: " + this);
|
|
454
|
+
}
|
|
417
455
|
if (oGroupLock && this.isTransient() && !this.isInactive()) {
|
|
418
456
|
oValue = this.getValue();
|
|
419
457
|
oPromise = oValue && _Helper.getPrivateAnnotation(oValue, "transient");
|
|
@@ -875,12 +913,28 @@ sap.ui.define([
|
|
|
875
913
|
*/
|
|
876
914
|
Context.prototype.hasPendingChanges = function () {
|
|
877
915
|
return this.isTransient()
|
|
916
|
+
|| this.isDeleted()
|
|
878
917
|
|| this.oModel.getDependentBindings(this).some(function (oDependentBinding) {
|
|
879
918
|
return oDependentBinding.hasPendingChanges();
|
|
880
919
|
})
|
|
881
920
|
|| this.oModel.withUnresolvedBindings("hasPendingChangesInCaches", this.sPath.slice(1));
|
|
882
921
|
};
|
|
883
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Returns whether this context is deleted on the client, but not on the server yet. The result
|
|
925
|
+
* of this function can also be accessed via the "@$ui5.context.isDeleted" instance annotation
|
|
926
|
+
* at the entity.
|
|
927
|
+
*
|
|
928
|
+
* @returns {boolean} <code>true</code> if this context is deleted
|
|
929
|
+
*
|
|
930
|
+
* @public
|
|
931
|
+
* @see #delete
|
|
932
|
+
* @since 1.105
|
|
933
|
+
*/
|
|
934
|
+
Context.prototype.isDeleted = function () {
|
|
935
|
+
return this.bDeleted;
|
|
936
|
+
};
|
|
937
|
+
|
|
884
938
|
/**
|
|
885
939
|
* Tells whether the group node that this context points to is expanded.
|
|
886
940
|
*
|
|
@@ -1617,8 +1671,8 @@ sap.ui.define([
|
|
|
1617
1671
|
* <li> {@link sap.ui.model.odata.v4.ODataListBinding#resetChanges}.
|
|
1618
1672
|
* </ul>
|
|
1619
1673
|
* @throws {Error}
|
|
1620
|
-
* If the binding's root binding is suspended, for invalid group IDs,
|
|
1621
|
-
* not primitive
|
|
1674
|
+
* If the binding's root binding is suspended, for invalid group IDs, if the new value is
|
|
1675
|
+
* not primitive, or if the context is deleted
|
|
1622
1676
|
*
|
|
1623
1677
|
* @public
|
|
1624
1678
|
* @see #getProperty
|
|
@@ -313,6 +313,7 @@ sap.ui.define([
|
|
|
313
313
|
undefined, sGroupId, oOldCache);
|
|
314
314
|
}
|
|
315
315
|
if (oOldCache && oOldCache !== oCache) {
|
|
316
|
+
oOldCache.deregisterChangeListener("", this);
|
|
316
317
|
oOldCache.setActive(false);
|
|
317
318
|
}
|
|
318
319
|
if (this.mLateQueryOptions) {
|
|
@@ -330,9 +331,12 @@ sap.ui.define([
|
|
|
330
331
|
* @since 1.66
|
|
331
332
|
*/
|
|
332
333
|
ODataBinding.prototype.destroy = function () {
|
|
334
|
+
var that = this;
|
|
335
|
+
|
|
333
336
|
this.mCacheByResourcePath = undefined;
|
|
334
337
|
this.oCachePromise.then(function (oOldCache) {
|
|
335
338
|
if (oOldCache) {
|
|
339
|
+
oOldCache.deregisterChangeListener("", that);
|
|
336
340
|
oOldCache.setActive(false);
|
|
337
341
|
}
|
|
338
342
|
}, function () {});
|
|
@@ -381,7 +385,7 @@ sap.ui.define([
|
|
|
381
385
|
* @private
|
|
382
386
|
*/
|
|
383
387
|
ODataBinding.prototype.doDeregisterChangeListener = function (sPath, oListener) {
|
|
384
|
-
this.oCache.
|
|
388
|
+
this.oCache.deregisterChangeListener(sPath, oListener);
|
|
385
389
|
};
|
|
386
390
|
|
|
387
391
|
/**
|
|
@@ -540,7 +544,7 @@ sap.ui.define([
|
|
|
540
544
|
// With $$aggregation, no auto-$expand/$select is needed
|
|
541
545
|
oQueryOptionsPromise = this.doFetchQueryOptions(oContext);
|
|
542
546
|
if (this.oModel.bAutoExpandSelect && this.aChildCanUseCachePromises
|
|
543
|
-
&& !this.mParameters
|
|
547
|
+
&& !_Helper.isDataAggregation(this.mParameters)) {
|
|
544
548
|
// For auto-$expand/$select, wait for query options of dependent bindings:
|
|
545
549
|
// Promise.resolve() ensures all dependent bindings are created and have sent their
|
|
546
550
|
// query options promise to this binding via fetchIfChildCanUseCache.
|
|
@@ -703,7 +707,7 @@ sap.ui.define([
|
|
|
703
707
|
}
|
|
704
708
|
// Can only become undefined when a list binding's context has been parked and is
|
|
705
709
|
// destroyed later. Such a context does no longer have a subpath of the binding's
|
|
706
|
-
// path. The only caller in this case is ODataPropertyBinding#
|
|
710
|
+
// path. The only caller in this case is ODataPropertyBinding#deregisterChangeListener
|
|
707
711
|
// which can safely be ignored.
|
|
708
712
|
return sRelativePath;
|
|
709
713
|
}
|
|
@@ -1293,8 +1297,7 @@ sap.ui.define([
|
|
|
1293
1297
|
|
|
1294
1298
|
/**
|
|
1295
1299
|
* Recursively visits all dependent bindings of (the given context of) this binding. Bindings
|
|
1296
|
-
* with an own cache will request side effects themselves as applicable.
|
|
1297
|
-
* in <code>mNavigationPropertyPaths</code> will refresh themselves.
|
|
1300
|
+
* with an own cache will request side effects themselves as applicable.
|
|
1298
1301
|
*
|
|
1299
1302
|
* @param {string} sGroupId
|
|
1300
1303
|
* The group ID to be used for requesting side effects
|
|
@@ -1304,9 +1307,6 @@ sap.ui.define([
|
|
|
1304
1307
|
* because they may have changed due to side effects of a previous update
|
|
1305
1308
|
* @param {sap.ui.model.odata.v4.Context} [oContext]
|
|
1306
1309
|
* The context for which to request side effects; if missing, the whole binding is affected
|
|
1307
|
-
* @param {object} mNavigationPropertyPaths
|
|
1308
|
-
* Hash set of collection-valued navigation property meta paths (relative to this binding's
|
|
1309
|
-
* cache root) which need to be refreshed, maps string to <code>true</code>; read-only
|
|
1310
1310
|
* @param {Promise[]} aPromises
|
|
1311
1311
|
* List of (sync) promises which is extended for each call to
|
|
1312
1312
|
* {@link sap.ui.model.odata.v4.ODataParentBinding#requestSideEffects} or
|
|
@@ -74,7 +74,7 @@ sap.ui.define([
|
|
|
74
74
|
* @mixes sap.ui.model.odata.v4.ODataParentBinding
|
|
75
75
|
* @public
|
|
76
76
|
* @since 1.37.0
|
|
77
|
-
* @version 1.
|
|
77
|
+
* @version 1.105.1
|
|
78
78
|
*
|
|
79
79
|
* @borrows sap.ui.model.odata.v4.ODataBinding#getGroupId as #getGroupId
|
|
80
80
|
* @borrows sap.ui.model.odata.v4.ODataBinding#getRootBinding as #getRootBinding
|
|
@@ -235,7 +235,10 @@ sap.ui.define([
|
|
|
235
235
|
// the context(s) in that uppermost binding. Note that no data may be available in the
|
|
236
236
|
// uppermost context binding and hence the deletion would not work there, BCP 1980308439.
|
|
237
237
|
var oEmptyPathParentContext = this._findEmptyPathParentContext(this.oElementContext),
|
|
238
|
-
oEmptyPathParentBinding = oEmptyPathParentContext.getBinding()
|
|
238
|
+
oEmptyPathParentBinding = oEmptyPathParentContext.getBinding(),
|
|
239
|
+
oDeleteParentContext = oEmptyPathParentBinding.getContext(),
|
|
240
|
+
oReturnValueContext = oEmptyPathParentBinding.oReturnValueContext,
|
|
241
|
+
that = this;
|
|
239
242
|
|
|
240
243
|
// In case the uppermost parent reached with empty paths is a list binding, delete there.
|
|
241
244
|
if (!oEmptyPathParentBinding.execute) {
|
|
@@ -249,27 +252,27 @@ sap.ui.define([
|
|
|
249
252
|
// deleteFromCache call below. In Context#delete the error is reported.
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Destroys the element context and, if available, the return value context, and fires a
|
|
260
|
-
* change. The method is called by #_delete, possibly at another context binding for the same
|
|
261
|
-
* entity, after the successful deletion in the back end.
|
|
262
|
-
*
|
|
263
|
-
* @private
|
|
264
|
-
*/
|
|
265
|
-
ODataContextBinding.prototype._destroyContextAfterDelete = function () {
|
|
266
|
-
this.oElementContext.destroy();
|
|
267
|
-
this.oElementContext = null;
|
|
268
|
-
if (this.oReturnValueContext) {
|
|
269
|
-
this.oReturnValueContext.destroy();
|
|
270
|
-
this.oReturnValueContext = null;
|
|
255
|
+
oEmptyPathParentBinding.oElementContext = null;
|
|
256
|
+
if (oReturnValueContext) {
|
|
257
|
+
oEmptyPathParentBinding.oReturnValueContext = null;
|
|
271
258
|
}
|
|
272
259
|
this._fireChange({reason : ChangeReason.Remove});
|
|
260
|
+
return this.deleteFromCache(oGroupLock, sEditUrl, "", null).then(function () {
|
|
261
|
+
oEmptyPathParentContext.destroy();
|
|
262
|
+
if (oReturnValueContext) {
|
|
263
|
+
oReturnValueContext.destroy();
|
|
264
|
+
}
|
|
265
|
+
}, function (oError) {
|
|
266
|
+
if (!oEmptyPathParentBinding.isRelative()
|
|
267
|
+
|| oDeleteParentContext === oEmptyPathParentBinding.getContext()) {
|
|
268
|
+
oEmptyPathParentBinding.oElementContext = oEmptyPathParentContext;
|
|
269
|
+
if (oReturnValueContext) {
|
|
270
|
+
oEmptyPathParentBinding.oReturnValueContext = oReturnValueContext;
|
|
271
|
+
}
|
|
272
|
+
that._fireChange({reason : ChangeReason.Insert});
|
|
273
|
+
}
|
|
274
|
+
throw oError;
|
|
275
|
+
});
|
|
273
276
|
};
|
|
274
277
|
|
|
275
278
|
/**
|
|
@@ -1450,9 +1453,6 @@ sap.ui.define([
|
|
|
1450
1453
|
*/
|
|
1451
1454
|
ODataContextBinding.prototype.requestSideEffects = function (sGroupId, aPaths, oContext) {
|
|
1452
1455
|
var oModel = this.oModel,
|
|
1453
|
-
// Hash set of collection-valued navigation property meta paths (relative to the cache's
|
|
1454
|
-
// root) which need to be refreshed, maps string to <code>true</code>
|
|
1455
|
-
mNavigationPropertyPaths = {},
|
|
1456
1456
|
aPromises = [],
|
|
1457
1457
|
that = this;
|
|
1458
1458
|
|
|
@@ -1476,10 +1476,9 @@ sap.ui.define([
|
|
|
1476
1476
|
try {
|
|
1477
1477
|
aPromises.push(
|
|
1478
1478
|
this.oCache.requestSideEffects(this.lockGroup(sGroupId), aPaths,
|
|
1479
|
-
|
|
1479
|
+
oContext && oContext.getPath().slice(1)));
|
|
1480
1480
|
|
|
1481
|
-
this.visitSideEffects(sGroupId, aPaths, oContext,
|
|
1482
|
-
aPromises);
|
|
1481
|
+
this.visitSideEffects(sGroupId, aPaths, oContext, aPromises);
|
|
1483
1482
|
|
|
1484
1483
|
return SyncPromise.all(aPromises.map(reportError)).then(function () {
|
|
1485
1484
|
return that.refreshDependentListBindingsWithoutCache();
|