openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Discard deprecated Responses of previous JSONModel.loadData()-Calls

Open kleferbe opened this issue 11 years ago • 3 comments

Hi,

i have an issue with the JSONModel (but the same applies to the XMLModel):

var model = new sap.ui.model.json.JSONModel();
//the user selects a master item that loads a very long detail list
model.loadData("/resource_taking_5_seconds_to_answer"); //long list
//after 2 seconds the user selects an other master item that loads an much shorter detail list
model.loadData("/resource_taking_1_seconds_to_answer"); //short list
//The response of the first slow request overwrites the data of the faster second request!

The JSONModel.loadData()-Method should only accept the response of the last issued ajax request when merge = false.

Yes, i could use $.ajax() and handle this my self as a workaround. But i think the JSONModel.loadData() should do it right.

As a possible solution, i would clear the this.aPendingRequestHandles in ClientModel line 116 when the merge option is false.

Have a nice day, Bernhard

kleferbe avatar Nov 30 '15 09:11 kleferbe

Hi,

yes, this sounds like a bug. I opened internal ticket 1570846343 for it for tracking.

Thanks and regards Andreas

akudev avatar Dec 01 '15 09:12 akudev

Hi, we'll change the behaviour with 1.38. The sync data loading does not change, but we sequentialize async requests. BR, Jan

loginger avatar Apr 18 '16 10:04 loginger

Should be this commit: https://github.com/SAP/openui5/commit/5f983a527d651214a9f6734ae5119acc6b684421

akudev avatar Apr 18 '16 11:04 akudev