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:
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
}
},

The
v4.ODataModeleventpropertyChangeis available only since UI5 1.110.Press Ctrl+Shift+Left Alt / Left-Option+P in the app to see with which UI5 version the app is running.