Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Unsupported event 'propertyChange': v4.ODataModel#attachEvent

friendlycoder
Participant
0 Kudos

Hi all,

Trying to attach a function to the method attachPropertyChange on the sap.ui.model.odata.v4.ODataModel

onAfterRendering: function () {
var oModel = this.getView().getModel(); //based on sap.ui.model.odata.v4.ODataModel
oModel.attachPropertyChange(() => console.log("hello"));
}

in the console it appears:

friendlycoder_0-1710252893734.png

Has the event `PropertyChange` been deprecated on `sap.ui.model.odata.v4.ODataModel`?

Has the event `PropertyChange` been deprecated on `sap.ui.model.odata.v4.ODataModel`?

The model is defined in `manifest.json` file and it has the version 4.0

"dataSources": {
"mainService": {
"uri": "/sap/opu/odata4/sap/ui_sensitivefielditem/srvd/sap/ui_sensitivefielditem/0001/",
"type": "OData",
"settings": {
"annotations": [
"annotation"
],
"localUri": "localService/metadata.xml",
"odataVersion": "4.0"
}
},
"annotation": {
"type": "ODataAnnotation",
"uri": "annotations/annotation.xml",
"settings": {
"localUri": "annotations/annotation.xml"
}
}
}
},


"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "com.swisslife.vimsensitivefielditem.i18n.i18n"
}
},
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true
}
},

Best regards

 

1 REPLY 1

NTeunckens
Active Contributor
0 Kudos

Is this Question the same as "odata - Error: Unsupported event 'propertyChange': v4.ODataModel#attachEvent - Stack Overflow"? Suggestion that is offered is to verify your SAPUI-version : API Reference - Demo Kit - SAPUI5 SDK (ondemand.com) as the 'PropertyChange' is only available from "SAPUI5 1.110.0" ...

(Full disclosure : I do not claim to have the export knowledge regarding the solution, it was provided elsewhere by another person.)