I have the following odata structrue: appointment, and every appointment has attachments, but the attachments data will be deferred.
Usually I get appointment data with deferred attachments data firstly.Then, I would send a batch request to get all the data for the detail view. One of the requests is to expand attachements data.
The question is how to access the previous odata model and change it with expanded data? The following is my piece of code, but it doesn't work.
// submit the batch reqeust and get the batch response ....... // access and change the model with expanded data in batch request call back function var sPath = "/AppointmentSet(guid'" + appointmentID + "')"; var oModel = this. getView().getModel(); oModel.setProperty(sPath, oResponse.data); oModel.submitChanges();
In Chrome debug mode, I checked that oModel.data didn't change at all.
Any help is appreciated!