-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 6 Jul 2006, Carsten Ziegeler wrote:

Date: Thu, 06 Jul 2006 08:32:19 +0200
From: Carsten Ziegeler <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [CForms] Load/Save model events never send?

Quoin Developers wrote:
Actually, it appears that I can save from an action handler - but it's
a little tricky and probably not the recommended way (calling validate
on the Form from the action handler).

form.form.validate()
if (form.form.isValid()) {
form.save(facade);
facade.save();
form.getChild("contentMessages").addMessage(new I18nMessage('saved',
'application'));
}

Uh, that's ugly. Now my intention with the phase checking for save was
that you can only save if the form is valid which imho makes sense.
Saving an invalid form can lead to unpredictable situations I guess.

Now, I would be interested in other opinions. Should we remove these
checks or not?

Will this enable to try to store something like "abc" into a integer
widget/model (which obviously would raise an Exception). If this would
be possible I would certainly be against allowing unvalidated/invalid-state saves.

- -- Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)

iD8DBQFErMMYLNdJvZjjVZARAqkXAKDn8Hk5P1WYImgalr4JfobFwYUp7QCbBgVe
GHLni3NsKiyKJPDBlaXQM74=
=GmRq
-----END PGP SIGNATURE-----

Reply via email to