-
22 Jan 2008 12:32 PM #1
DwrProxy improved
DwrProxy improved
This is for Ext 2.x. Please see http://www.extjs.com/forum/showthread.php?p=343185 for the Ext 3.x compatible release.
DwrProxy is now part of a larger ExtJsWithDwr project on GitHub (see form post).
What does this mean?- DWRProxy has been renamed to DwrProxy (although DWRProxy) is provided for backwards compatibility.
- The code is publically available and easy to check out.
- Official examples have been created that demonstrate DwrProxy in action. They're part of the GitHub project or can be seen here: http://biglep.s156.eatj.com/extJsWithDwrExamples/.
- Now that all this overhead is taken care for DwrProxy, work on Ext 3.x support will come next week.
Where can I find the code?
http://github.com/BigLep/ExtJsWithDw...ta/DwrProxy.js
Why was this class created?
I found Axel's DWRProxy class in this thread a great starting point for enabling me to have a combobox load data through DWR. There were a couple of issues though that I experienced and saw in the original thread and others. Those issues were:- Not compatible with Ext provided readers (e.g. ArrayReader and JSONReader).
- Arguments to the DWR function weren't guaranteed to be in the required order needed for the backend.
There were the additional minor issues that:- The beforeload event wasn't "vetoable" like it was with every proxy.
- DWRProxy wasn't in the Ext.ux namespace.
Updates:- 2/21/08 - Fixed bug with exceptionHandler. Also corrected the spacing/indentation.
- 3/7/08 - Fixed additional bug with exceptionHandler.
- 3/12/08 - Fixed additional bug with exceptionHandler.
- 5/24/09 - Renamed to DwrProxy (DWRProxy is added for backwards compatiblity) and posted project on GitHub.
Last edited by loeppky; 22 Oct 2009 at 9:27 AM. Reason: Announced GitHub ExtJsWithDwrProject
-
22 Jan 2008 12:37 PM #2
-
23 Jan 2008 6:40 AM #3
done like you wrote and got exception
Ext.ux.data has no properties
proxy: new Ext.ux.data.DWRProxy({
can you help ?
-
23 Jan 2008 7:01 AM #4
dwr proxy how to use it to load data...
dwr proxy how to use it to load data...
I have a DWR remote method that returns a List of Person [name, surname].
I'd like to show them in a GridPanel.
If I load the data thru a Store like this:
it works fine.Code:var myReader = new Ext.data.ArrayReader({}, [ {name: 'name'}, {name: 'surname'} ]); var myStore = new Ext.data.Store({ data: myPeople, reader: myReader });
But if I use a proxy like this:
Code:var dwrproxy = new Ext.ux.data.DWRProxy({ dwrFunction: MyDwrService.getPersone, listeners: { 'beforeload': function(dataProxy, params){} } });
It does not work, that is, the grid gets rendered, but without any data.
I see the people data list coming from the server passing thru my firfox firebug, and actually the the server gets called.
What is wrong?
I tried to use both this version of DwrProxy and the previous posted one, but none of them seems to work properly. Where am I wrong at ?
thank you
-
23 Jan 2008 10:44 AM #5
-
23 Jan 2008 11:11 AM #6
Timido,
What is the method signature of MyDwrService.getPersone? What parameters does it take, and what does it return?
Also, note that your "beforeload" listener in the DWRProxy isn't doing anything, and thus is unnecessary.
-
23 Jan 2008 7:52 PM #7
Great job!
but i have some troubles
could you tell me how to pass param by queryParam
how to use the property of queryParam
thanks
-
23 Jan 2008 10:07 PM #8
fix my exception, was in wrong path to dwrproxy.js.
cound you also say can i put data in GridPanel? with proxy
-
24 Jan 2008 1:36 AM #9
hi, here is the method sign:
I cant get the list to be loaded into the gridCode:public List getPersone() { List persone = new ArrayList(); Persona p1 = new Persona("john", "smith"); Persona p2 = new Persona("andy", "garcia"); Persona p3 = new Persona("ricky", "martin"); Persona p4 = new Persona("ricky", "martin"); persone.add(p1); persone.add(p2); persone.add(p3); persone.add(p4); log.info("GET PERSONE"); return persone; }
Thank you for any hints
-
24 Jan 2008 2:33 PM #10
SmartChow: this is real easy to do. In the original example, if you defined your combobox to have a queryParam of 'differentQueryParam', then the "beforeload" listener would look like:
Code:'beforeload': function(dataProxy, params){ // setting the args that will get passed to the DWR function params[dataProxy.loadArgsKey] = ['loeppkyIsMyUserId', params.differentQueryParam]; }


Reply With Quote