I am trying to fetch some data from the backend and I have the following code:
I defined the oData service in the manifest.json:
"DummyName": {
"type": "sap.ui.model.odata.v2.ODataModel",
"settings": {
"defaultBindingMode": "TwoWay",
"defaultCountMode": "Request",
"sequentializeRequests": true
},
"dataSource": "C_VIEW",
"preload": true
}
}
and I have the following coding in my controller:
var oModel = this.getView().getModel("DummyName");
I retrieve the service and then I can do the following:
I'll get the path to the parent node and I save it in the variable sPath.
var sPath = this.getPath();
Now that parent node has basically two subnodes I can call with expansion like the following:
var subnode1 = oModel.getProperty("/" + sPath + '/subNode1');
so far this works great, what doesn't work is if I do the same with my subNode2:
var subnode2 = oModel.getProperty("/" + sPath + '/subNode2');
variable subnode2 will remain undefined, I checked oModel in the console and saw some weird behavior:
for that subnode1 I will see a ___list:
I can open and find the exact subnode I can retrieve with the sPath + expansion, for the subnode2 I see instead a __defereed: with some super weird URI behind, maybe someone knows what is missing here?