PDA

View Full Version : Error Handling With Data Stores



garytaylor
6 Jul 2009, 10:37 PM
Hi,
I have an admin application that uses the new RESTful data stores in ext 3.
The page I am working on has a single data store configured with a JSON reader and writer. It is intended to be quite a simple 'summary-detail' type of page where the user selects the record that they want to edit in a grid and the details of the record are shown in a form panel.
Inside the form is a field called 'url_word' that needs to be unique and is currently validated by the backend as the data would get in a mess if a duplicate value was inserted.
So, rather than write some form of remote validator, I thought the best thing to do was to allow the backend to do its validation upon creation and update.
I am returning false in the success property of the response , a messages array and an errors array. Whether the response is correct or not I do not yet know as I stumbled across this potential issue.

The issue that I think exists, but I am hoping someone will tell me otherwise is that the data store knows nothing about form field errors ?
I know that I can mark various fields in the form as having errors and they get highlighted etc..
However, as the store can update multiple records at once - what happens if one of the updated records fails validation from the back end ? Surely it needs to somehow store the error and when the record is loaded into the form, have the form display the errors ?

I would guess that the same issue would exists with the editable grid ?

Any help greatly appreciated

Gary

ikkeook
9 Jul 2009, 8:32 AM
can you share the code please? I need to build also a grid connected to a form for editing the data and this with a mysql database. I want to use the new JSON reader and writer-things. But i'm lost.

thanks for helping!!