Tuesday, June 17, 2008

Handle errors

Here I have a question for which I don't have a clear answer yet, and is what to do when trying to submit a batch-edition and the values provided for some of the fields is not valid. Can be an empty required field, or any other kind of validation error.

What I think we should be doing is:
  • not save changes for any object on the form
  • display the form with the given values on each input field, and the errors displayed
  • allow the user to disable the re-submit of problematic objects with a check box next to each.
  • A global disable all problematic objects check box for JavaScript enabled browsers.
This way, if the user have dozens of objects with correct data, and only a couple are failing, he can save the correct ones, and later care about the problematic ones.

Previously, Martin suggested to put the disable check box at the beggining, which I also think it's good idea.

Again, your comments will be very appreciated.

1 comment:

Anonymous said...

Have you looked at plone.z3cform.crud?

It doesn't support batch editing heterogeneous objects, but frankly, I think that's rather confusing anyway.

What it does with handling errors is that it saves changes to all objects that succeeded validation and displays errors for those objects that failed validation.