-
5 Apr 2010 1:12 PM #1
DataWriter Example does not work with DirectProxy
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- The read works fine and the grid populates

- Request: Code:
{"action":"WriterDirect","method":"readUserInfo","data":null,"type":"rpc","tid":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"}
- Request:
- the delete does not send an ID so that fails on the server
- Req: Code:
{"action":"WriterDirect","method":"destroyUser","data":[],"type":"rpc","tid":3} - Resp:
Code:{"tid":3,"action":"WriterDirect","method":"destroyUser","message": "ArrayIndexOutOfBoundsException: 0","where": "java.lang.ArrayIndexOutOfBoundsException:...", "type":"exception"}
- Req:
- the create blows up in the Ext.direct.RemotingProvider doForm method ext-all-debug.js:39939 ... The error is "form is undefined"
- the update blows in the same place saying "form is undefined"
ext-all-debug.js:39939 (version 3.2.0)
I'm pulling the same ext libraries as the example.Code:var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data',
- The read works fine and the grid populates
-
6 Apr 2010 5:34 AM #2
-
8 Apr 2010 7:35 AM #3
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.
-
11 Oct 2010 8:37 PM #4
BUG!?!
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)
When using DirectProxy, doForm() is called with a form argument which is not a real form,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',
it's just a simple Object (containing the params)...
Help!! is this a bug?
-
12 Oct 2010 12:40 PM #5
Oops, nevermind, I was using formHandler:true in the API
:/


Reply With Quote