1. #1
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default 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:
    1. Not compatible with Ext provided readers (e.g. ArrayReader and JSONReader).
    2. 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:
    1. The beforeload event wasn't "vetoable" like it was with every proxy.
    2. 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

  2. #2
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    Here

  3. #3
    Ext User
    Join Date
    Jan 2008
    Posts
    4
    Vote Rating
    0
    Artem is on a distinguished road

      0  

    Default


    done like you wrote and got exception
    Ext.ux.data has no properties
    proxy: new Ext.ux.data.DWRProxy({

    can you help ?

  4. #4
    Sencha User
    Join Date
    Jan 2008
    Posts
    16
    Vote Rating
    0
    Timido is on a distinguished road

      0  

    Default 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:

    Code:
        var myReader = new Ext.data.ArrayReader({}, [
            {name: 'name'},
            {name: 'surname'}
        ]);
    
        var myStore = new Ext.data.Store({
                data: myPeople,
                reader: myReader
            });
    it works fine.

    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

  5. #5
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    Quote Originally Posted by Artem View Post
    done like you wrote and got exception
    Ext.ux.data has no properties
    proxy: new Ext.ux.data.DWRProxy({
    Artem, the fact that "Ext.ux.data has no properties" suggests that you didn't create the namespace. Did you copy the first line of the DWRProxy class post: "Ext.namespace("Ext.ux.data");"?

  6. #6
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    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.

  7. #7
    Ext User
    Join Date
    Jan 2008
    Posts
    5
    Vote Rating
    0
    SmartChow is on a distinguished road

      0  

    Default


    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

  8. #8
    Ext User
    Join Date
    Jan 2008
    Posts
    4
    Vote Rating
    0
    Artem is on a distinguished road

      0  

    Default


    fix my exception, was in wrong path to dwrproxy.js.
    cound you also say can i put data in GridPanel? with proxy

  9. #9
    Sencha User
    Join Date
    Jan 2008
    Posts
    16
    Vote Rating
    0
    Timido is on a distinguished road

      0  

    Default


    Quote Originally Posted by loeppky View Post
    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.
    hi, here is the method sign:

    Code:
        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;
    
        }
    I cant get the list to be loaded into the grid
    Thank you for any hints

  10. #10
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    Quote Originally Posted by SmartChow View Post
    could you tell me how to pass param by queryParam
    how to use the property of queryParam
    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]; 
    }

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."