1. #1
    Ext User
    Join Date
    Nov 2009
    Posts
    15
    Vote Rating
    0
    jcalfee is on a distinguished road

      0  

    Talking DataWriter Example does not work with DirectProxy

    In the Grid Writer example, if you replace the HttpProxy with a DirectProxy only the read API call works:

    http://www.extjs.com/deploy/dev/exam...er/writer.html
    1. The read works fine and the grid populates
      1. Request:
        Code:
        {"action":"WriterDirect","method":"readUserInfo","data":null,"type":"rpc","tid":2}
      2. Response:
        Code:
        {"tid":2,"action":"WriterDirect","method":"readUserInfo","result":{"total":
            0,"success":true,"message":"Here is your example data...","data":[{"id":
                1,"email":"user@example.com","first":"UserFirst","last":"UserLast"}]},
          "type":"rpc"}
    2. the delete does not send an ID so that fails on the server
      1. Req:
        Code:
        {"action":"WriterDirect","method":"destroyUser","data":[],"type":"rpc","tid":3}
      2. Resp:
        Code:
        {"tid":3,"action":"WriterDirect","method":"destroyUser","message":
          "ArrayIndexOutOfBoundsException: 0","where":
          "java.lang.ArrayIndexOutOfBoundsException:...",
          "type":"exception"}
    3. the create blows up in the Ext.direct.RemotingProvider doForm method ext-all-debug.js:39939 ... The error is "form is undefined"
    4. the update blows in the same place saying "form is undefined"

    ext-all-debug.js:39939 (version 3.2.0)
    Code:
    var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',
    I'm pulling the same ext libraries as the example.

  2. #2
    Ext User
    Join Date
    Nov 2009
    Posts
    15
    Vote Rating
    0
    jcalfee is on a distinguished road

      0  

    Default wait, it must be my API instead of DirectProxy

    Quote Originally Posted by jcalfee View Post
    In the Grid Writer example, if you replace the HttpProxy with a DirectProxy only the read API call works
    Hold up... I think I had an error in my API. I'm still working this out. Thanks...jc

  3. #3
    Ext User
    Join Date
    Mar 2010
    Posts
    14
    Vote Rating
    0
    kodomo is on a distinguished road

      0  

    Default

    When you change from a HttpProxy to a DirectProxy you need to set "encode: false" in the JsonWriter. If you don't, the transactions go with no data.

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Location
    Paris, France
    Posts
    5
    Vote Rating
    0
    dgaspar is on a distinguished road

      0  

    Default BUG!?!

    Hi, I'm having the same problem with create in DataWriter example, when I try to use DirectProxy!

    (obs: I've set encode to false, so delete works... but not create)

    Code:
        doForm : function(c, m, form, callback, scope){
         
            ...
    
            if(this.fireEvent('beforecall', this, t, m) !== false){
                Ext.Direct.addTransaction(t);
                // bug!!
                var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',
    When using DirectProxy, doForm() is called with a form argument which is not a real form,
    it's just a simple Object (containing the params)...

    Help!! is this a bug?

  5. #5
    Sencha User
    Join Date
    Oct 2010
    Location
    Paris, France
    Posts
    5
    Vote Rating
    0
    dgaspar is on a distinguished road

      0  

    Default

    Oops, nevermind, I was using formHandler:true in the API

    :/

Thread Participants: 2