PDA

View Full Version : Sencha touch model.load(id,..) returning cached model data with id requested



karencc
12 Mar 2013, 11:20 PM
I am using sencha touch 2.1.0, I have a 'list' of items a user can select on the tap of the list i.e onListItemSelect i am getting the id of the item selected and trying to load the model using an ajaxproxy.


I can see very clearly a correct 'get' executes and the correct data is returned from the server but in sencha touch ocassionally one of the previously selected model gets loaded.


recordcase = Ext.ModelManager.getModel('WMSApp.model.CaseBean');
recordcase.load(casdRecordId,{scope:this,reload:true,




success:function(resource) {
caseRecord = resource;
WMSApp.app.getController('WMSApp.controller.FrontController').setSelectedCaseBean(caseRecord);


},
failure:function(record, operation) {


console.log("Failed to load Selected Case Bean! ")




} });




i.e resource variable has value of some older model,
where are these models being cached and how can i force reinitialization of resource variable.


in my loader and models i have used the nocache settings, I am really confused please give me any solutions !!

BostonMerlin
13 Mar 2013, 12:18 PM
this might not have anything to do with your specific issue as it sounds like you're testing within the browser on your dev box but iOS6 introduced a bug (Apple considers this a performance enhancement) where iOS caches XHR (ajax) requests after the initial call to the same url. Again, might not be you're specific issue but try throwing a timestamp at your url call to force its uniqueness.

Hope that helps
John

karencc
13 Mar 2013, 8:55 PM
I am very sure from the get requests in network tab of chrome that the correct data is sent by server,
It is sencha part that i feel is not loading that retrieved data correctly everytime but picking some cached models.