[Zope-CMF] Re: Validation during object creation

Geoff Davis geoff@geoffdavis.net
Tue, 9 Jul 2002 09:07:56 -0400


----- Original Message -----
From: "Chris Withers" <chrisw@nipltd.com>
To: "Geoff Davis"
Cc: "Zope CMF" <zope-cmf@zope.org>
Sent: Tuesday, July 09, 2002 6:45 AM
Subject: Re: [Zope-CMF] Re: Validation during object creation


> Geoff Davis wrote:
> >
> > * I want to ensure that the user specifies certain attribute properties
> > before I create an object.  I want to require more than an ID and a
Title.
> > I don't want partially-populated objects lying around that I will have
to
> > clean up later.
>
> Can they be pre-populated with sensible defaults to avoid this?

Sure, in some cases, maybe, but not in all.  I see this kind of constructor
authentication as a way of enforcing something analogous to referential
integrity within a portal.  I want to know that I only have valid objects
lying around so I don't have to do things like stick a bunch of extra tests
for validity in my code, add code to clean up invalid objects, or add extra
UI for dealing with invalid objects.

>
> > * When a user does not fill out a form correctly, I want to display both
> > error messages and the user's original entries on the same form.  *** I
> > don't want the user to get kicked to a different page with error
messages
> > and then have to hit the back button to make corrections. ***
>
> Why not? <0.6 wink>
>

Relying on the back button sucks from a usability perspective:

1) The user is presented with a list of problems with his/her form on a
separate page.  S/he then has to back up and remember what the problems
were.  Much better to flag the problems in the same place they need to be
fixed.

2) The server can't ensure that the client will repopulate the form when the
back button is pressed.  If the client doesn't, a single user error means
the user has to fill out the entire form again -- that's a _huge_ pain.  If
you are forcing pages to not cache (e.g. if you're working with a secure
application, or you are trying to work nicely with a caching proxy), the
back button won't repopulate forms.  Even without no-cache directives, I
have seen spurious back button behavior in some versions of IE 5.

I think it wouldn't be that hard to build better form handling into Zope,
and in the interim I think it would be great to have this kind of capability
available in the CMF.

Geoff Davis
http://www.geoffdavis.net