on 03-26-2015 9:11 AM
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!
B.R.
Yang
In simple term, how to refresh the odata model after the batch request?
The batch request doesn't seem to refresh the odata model automatically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Normally the odata model will refresh automatically after any explicit odata operation, like read, update, etc. But my scenario is that the data model does not refresh automatically after it sending a batch request. So all the view elements binded to the change data won't resovle at all.
Do you mean oModel.refresh()?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.