fzammetti
6 Apr 2009, 7:44 AM
Hi folks... we did our daily v3 SVN updates today and experienced a very serious (for us) breakage.
We use DWR here, so we're using a DWR proxy (pretty much what you can find posted in the forums in the past, with some relatively minor changes for our needs). The issue, simply-stated, is that our DWR calls are never going through, nor are events firing on the proxy. Here's the proxy code:
Ext.namespace("Ext.ux");
Ext.ux.DWRDataProxy = function(inConfig){
Ext.apply(this, inConfig);
Ext.ux.DWRDataProxy.superclass.constructor.call(this);
};
Ext.extend(Ext.ux.DWRDataProxy, Ext.data.DataProxy, {
dwrFunction : null,
loadArgsKey : "dwrFunctionArgs",
load : function(inParams, inReader, inCallback, inScope, inArgs) {
var dataProxy = this;
if (dataProxy.fireEvent("beforeload", dataProxy, inArgs) !== false) {
var loadArgs = inArgs[this.loadArgsKey] || inArgs;
var dwrFunctionArgs = [];
if (loadArgs instanceof Array) {
for (var i = 0; i < loadArgs.length; i++) {
dwrFunctionArgs.push(loadArgs[i]);
}
} else {
for (var loadArgName in loadArgs) {
dwrFunctionArgs.push(loadArgs[loadArgName]);
}
}
dwrFunctionArgs.push({
callback : function(inResponse) {
var records = inReader.readRecords(inResponse);
dataProxy.fireEvent("load", dataProxy, inResponse, inCallback);
inCallback.call(inScope, records, inArgs, true);
},
exceptionHandler : function(inMessage, inException) {
dataProxy.fireEvent("loadexception", dataProxy, inMessage,
inCallback, inException);
inCallback.call(inScope, null, inArgs, false);
}
});
this.dwrFunction.apply(Object, dwrFunctionArgs);
} else {
callback.call(inScope || this, null, inArgs, false);
}
}
});And here's a DataStore using this proxy:
wiView.tabA.itemsStore = new Ext.data.Store({
proxy : new Ext.ux.DWRDataProxy({
dwrFunction : Delegate.getItems,
listeners : {
beforeload : function(inDataProxy, inParams) {
inParams[inDataProxy.loadArgsKey] = [wiView.param1];
return true;
},
load : function(inStore, inRecords, inOptions) {
wiView.tabA.dataLoaded = true;
Ext.getCmp("tabA").setTitle(
"Number of items: " + inRecords.length);
},
loadexception : function(inProxy, inMessage, inCallback, inException) {
Ext.MessageBox.show({
animEl : "divSource", buttons : Ext.MessageBox.OK,
title : "error", msg : "error"
});
}
}
}),
reader :
new Ext.data.ArrayReader({}, wi.ItemRecord)
});This store is bound to a Grid. Before this morning's v3 updates, this all worked 100%, and the code hasn't been changed recently. I've done some debugging and I can see that the beforeload event fires, but that's it... one that handler finishes, load in the proxy never gets called, nor does load in the store.
Is anyone aware of any v3 changes that might account for this? This is a major blocker for us at the moment so I'm hoping to get some kind of answer ASAP.
Thanks,
Frank
We use DWR here, so we're using a DWR proxy (pretty much what you can find posted in the forums in the past, with some relatively minor changes for our needs). The issue, simply-stated, is that our DWR calls are never going through, nor are events firing on the proxy. Here's the proxy code:
Ext.namespace("Ext.ux");
Ext.ux.DWRDataProxy = function(inConfig){
Ext.apply(this, inConfig);
Ext.ux.DWRDataProxy.superclass.constructor.call(this);
};
Ext.extend(Ext.ux.DWRDataProxy, Ext.data.DataProxy, {
dwrFunction : null,
loadArgsKey : "dwrFunctionArgs",
load : function(inParams, inReader, inCallback, inScope, inArgs) {
var dataProxy = this;
if (dataProxy.fireEvent("beforeload", dataProxy, inArgs) !== false) {
var loadArgs = inArgs[this.loadArgsKey] || inArgs;
var dwrFunctionArgs = [];
if (loadArgs instanceof Array) {
for (var i = 0; i < loadArgs.length; i++) {
dwrFunctionArgs.push(loadArgs[i]);
}
} else {
for (var loadArgName in loadArgs) {
dwrFunctionArgs.push(loadArgs[loadArgName]);
}
}
dwrFunctionArgs.push({
callback : function(inResponse) {
var records = inReader.readRecords(inResponse);
dataProxy.fireEvent("load", dataProxy, inResponse, inCallback);
inCallback.call(inScope, records, inArgs, true);
},
exceptionHandler : function(inMessage, inException) {
dataProxy.fireEvent("loadexception", dataProxy, inMessage,
inCallback, inException);
inCallback.call(inScope, null, inArgs, false);
}
});
this.dwrFunction.apply(Object, dwrFunctionArgs);
} else {
callback.call(inScope || this, null, inArgs, false);
}
}
});And here's a DataStore using this proxy:
wiView.tabA.itemsStore = new Ext.data.Store({
proxy : new Ext.ux.DWRDataProxy({
dwrFunction : Delegate.getItems,
listeners : {
beforeload : function(inDataProxy, inParams) {
inParams[inDataProxy.loadArgsKey] = [wiView.param1];
return true;
},
load : function(inStore, inRecords, inOptions) {
wiView.tabA.dataLoaded = true;
Ext.getCmp("tabA").setTitle(
"Number of items: " + inRecords.length);
},
loadexception : function(inProxy, inMessage, inCallback, inException) {
Ext.MessageBox.show({
animEl : "divSource", buttons : Ext.MessageBox.OK,
title : "error", msg : "error"
});
}
}
}),
reader :
new Ext.data.ArrayReader({}, wi.ItemRecord)
});This store is bound to a Grid. Before this morning's v3 updates, this all worked 100%, and the code hasn't been changed recently. I've done some debugging and I can see that the beforeload event fires, but that's it... one that handler finishes, load in the proxy never gets called, nor does load in the store.
Is anyone aware of any v3 changes that might account for this? This is a major blocker for us at the moment so I'm hoping to get some kind of answer ASAP.
Thanks,
Frank