-
4 Jun 2009 8:23 AM #1
[CLOSED][3.0rc2] More RC2 proxy problems
[CLOSED][3.0rc2] More RC2 proxy problems
Yesterday I had an issue where my custom DataProxy wasn't working and Aaron pointed out an API change that was the cause. Today we discovered another problem with the same proxy code. For reference, here's the updated code:
The problem we're seeing is that the load listener is never firing. Here's an example usage: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, load : function(inParams, inReader, inCallback, inScope, inArgs) { var dataProxy = this; if (dataProxy.fireEvent("beforeload", dataProxy, inArgs) !== false) { var dwrFunctionArgs = []; if (inArgs) { if (inArgs instanceof Array) { for (var i = 0; i < inArgs.length; i++) { dwrFunctionArgs.push(inArgs[i]); } } else { dwrFunctionArgs.push(inArgs); } } 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); } }, doRequest : function(action, rs, params, reader, cb, scope, opts) { this.load(params, reader, cb, scope, opts); }, request : function(action, rs, params, reader, callback, scope, options) { params = params || {}; if ((action === Ext.data.Api.actions.read) ? this.fireEvent("beforeload", this, params) : this.fireEvent("beforewrite", this, action, rs, params) !== false) { this.doRequest.apply(this, arguments); } else { callback.call(scope || this, null, options, false); } } });
The alert() never shows up, the load handler never executes.Code:myNamespace.itemsStore = new Ext.data.Store({ proxy : new Ext.ux.DWRDataProxy({ dwrFunction : DWRDelegate.getItems, listeners : { beforeload : function(inDataProxy, inParams) { inParams[inDataProxy.loadArgsKey] = [myNamespace.provider]; return true; }, load : function(inStore, inRecords, inOptions) { alert("done"); }, loadexception : function(inProxy, inMessage, inCallback, inException) { Ext.MessageBox.show({ animEl : "divSource", buttons : Ext.MessageBox.OK, title : "error", msg : "error" }); } } }), reader : new Ext.data.ArrayReader({}, myNamespace.itemRecord) });
I have to ask the question, because RC2 has caused us a lot of troubles... are we at the point where API changes and new features are done being added and future RC's will truly be for the purpose of fixing bugs and stabilizing the code base? I've seen a lot of problems posted about RC2, more than RC1, not something you tend to want to see with RC's, and having to tell my boss that we're seeing breakages with each release isn't a pleasant thing to do, even when they are relatively minor... I would also suspect, based on what I've seen, that the 6/15 target release date is in jeopardy right now, would that be fair? Or do we think we're still on track for that date, roughly?
In any case, pointers on this particular issue would be greatly appreciated.
Thanks,
FrankFrank W. Zammetti
Author of "Practical Palm Pre webOS Projects"
and "Practical Ext JS Projects with Gears"
and "Practical Dojo Projects"
and "Practical DWR 2 Projects"
and "Practical JavaScript, DOM Scripting and Ajax Projects"
and "Practical Ajax Projects with Java Technology"
(For info: apress.com/book/search?searchterm=zammetti&act=search)
All you could possibly want is here: zammetti.com
-
4 Jun 2009 4:45 PM #2
In that same thread I thought I recall someone pointing out that you're using properties you shouldn't be, for example dwrFunction.
Also, loadexception is deprecated in favor of exception event. I believe docs say as much IIRC.
I went to example/xml-grid and updated the code to:
The load listener fired.Code:Ext.onReady(function(){ // create the Data Store var store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ // load using HTTP url: 'sheldon.xml', listeners:{ load:{ fn: function(){ console.info('load'); } } } }), // the return will be XML, so lets set up a reader reader: new Ext.data.XmlReader({MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
4 Jun 2009 6:32 PM #3
I didn't see the post that Chris made in the other thread because the thread had been closed before his post, so I didn't get a notification.
Reading it now, he doesn't seem to be saying that you can't use the parameter as I have it written, he seems to just be saying there maybe should be some standardization around it. In any event, I'm not sure I see why that should have any bearing on the load listener firing. Does anything look amiss in my code to you? (other than the point about loadexception, thanks for pointing that out).
I'm not familiar with the API changes that have been made frankly, there seems to be some pretty significant changes (which I really wish I wasn't seeing so close to a final release) so, I'm struggling to keep up with the changes and keep our code working. But, from everything I've read in this thread and the other one (http://extjs.com/forum/showthread.php?t=70251) I can't see any reason the load listener shouldn't be firing, and certainly what changed between RC1.1 and RC2 that broke it escapes me.
There's no difference between defining it the way I have:
...and the way you have...Code:listeners : { load : function(inStore, inRecords, inOptions) { alert("done"); } }
...is there? You're using fn where I'm not, but I didn't think that would make a different... am I perhaps wrong?Code:listeners : { load : { fn : function() { alert("done"); } }Frank W. Zammetti
Author of "Practical Palm Pre webOS Projects"
and "Practical Ext JS Projects with Gears"
and "Practical Dojo Projects"
and "Practical DWR 2 Projects"
and "Practical JavaScript, DOM Scripting and Ajax Projects"
and "Practical Ajax Projects with Java Technology"
(For info: apress.com/book/search?searchterm=zammetti&act=search)
All you could possibly want is here: zammetti.com
-
4 Jun 2009 7:45 PM #4
I haven't debugged your ux. I simply did a test to see if the standard Proxy implementation fired the event and it did.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
4 Jun 2009 7:58 PM #5
BTW, the thread was not closed, the title was updated to CLOSED status.
There's something going on with the forums lately where I do not get notifications if I do not visit a thread once I have received an email, especially if the posted messages are relatively close together. If there's a new post say a day later, than I will get that message. But there could be 50 posts in an hour and I won't get any of them.
Anyway, I suspect you may have gotten I notification message after your last post, but you may not of (if you're like me) received Chris' 2nd follow up.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
4 Jun 2009 8:05 PM #6
Yeah, I've noticed some weirdness with the forums too, but thought it might have just been me.
So should I take your previous reply to mean nothing jumps out at you as wrong in my code? The ux code didn't change between the upgrade from RC1.1 to RC2, so it's clearly caused by the update... just to be 100% sure, I just reverted back to RC1.1 and sure enough it works as expected. I'm just trying to determine if there's an API change in RC2 that I need to deal with in my code or if there's a bug in RC2. Testing the standard proxy implementation is worth doing, but ultimately doesn't shed any light on why the ux doesn't work, especially given that they look pretty similar as far as that event handler goes.Frank W. Zammetti
Author of "Practical Palm Pre webOS Projects"
and "Practical Ext JS Projects with Gears"
and "Practical Dojo Projects"
and "Practical DWR 2 Projects"
and "Practical JavaScript, DOM Scripting and Ajax Projects"
and "Practical Ajax Projects with Java Technology"
(For info: apress.com/book/search?searchterm=zammetti&act=search)
All you could possibly want is here: zammetti.com
-
4 Jun 2009 8:15 PM #7
Ok, but since it's not easy to have a drop in test case, what happens when you trace through the code?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
4 Jun 2009 8:30 PM #8
Another way I can think of that you could verify your code is to rename your ux HttpProxyMod or something. Basically what I'm getting at is you should be able to take the test case I posted above and just swap it to specify your custom proxy and check that it works. We all know the standard HttpProxy works, so if your version does not ... compare/debug.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
15 Jun 2009 8:18 AM #9
I am not sure what is wrong with fzammetti's version of DwrProxy, but I am maintaining the official version on GitHub (http://github.com/BigLep/ExtJsWithDwr/tree/v3), and the "load" event fires correctly and can be listened for. fzammetti can solve his immediate issue by upgrading.
That said, I think fzammetti's larger concern about the changes going on between release candidates is still valid.Do you use DWR? Check out: http://github.com/BigLep/ExtJsWithDwr
-
16 Aug 2009 12:17 PM #10
This thread has remained in INFOREQ status for some time now and I don't see any test case posted as requested per http://extjs.com/forum/showthread.ph...947#post341947 or any new information posted.
I'm going to update the status to CLOSED in absence of new information / test case. Please post again to have the issue reopened.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
Thank you for reporting this bug. We will make it our priority to review this report.





Reply With Quote