PDA

View Full Version : [CLOSED][3.0.0]Store 'write' event not fired if response 200 OK with {success:false}



MaximGB
8 Aug 2009, 6:21 PM
In documentation it is said that 'write' event is fired upon server 200OK response and that success or failure of the action is available in the result['successProperty'] property. Unfortunatly the event is fired only if success property === true, that prevents store users from doing any post processing upon failed write attempt.

p.s. Since there is the 'exception' event with all requried parameters for doing any postprocessing then this is the documentation bug only.

mjlecomte
8 Aug 2009, 9:37 PM
This was previously suggested FYI:
http://extjs.com/forum/showthread.php?t=75217


Hi!

I have a problem with my RESTful Store. If I have successefull answer after Update or Delete action all is ok and my Write event handler catches an even, but when in the server answer "success":false I get a silence. However API docs says:
"Write". Fires if the server returns 200 after an Ext.data.Api.actions CRUD action. Success or failure of the action is available in the result['successProperty'] property.


The docs are not correct, the docs do not describe what the code is doing.

write event will not be called if success status sent back is false. If you think that behavior is incorrect you're going to need to offer up details on why you think the current behavior (to not fire the write event) is incorrect ...

evant
4 Sep 2009, 12:56 AM
The documentation for this is incorrect, it's been corrected in SVN.

otatop
14 Oct 2009, 3:31 PM
If you open the manual to the restful services you will see a while section on status codes it talks specifically about how requiring the success property is wrong in a restful paradigm (see the paragraph starting with "One example of this, and one area of the Ext API that I'm prone to rant about"). If the restful flag is set to true, then the success property should not be required as specified in your own manual.

http://www.extjs.com/learn/Manual:RESTful_Web_Services

christocracy
14 Oct 2009, 8:42 PM
If the restful flag is set to true, then the success property should not be required as specified in your own manual.

With RESTful stores in 3.0.1+, the successProperty is required only when doing the create action.

However, this will be fixed after 3.0.3.