Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 47820 invoked from network); 4 Feb 2004 17:50:51 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 17:50:51 -0000 Received: (qmail 64849 invoked by uid 500); 4 Feb 2004 17:50:25 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 64712 invoked by uid 500); 4 Feb 2004 17:50:24 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 64575 invoked from network); 4 Feb 2004 17:50:23 -0000 Received: from unknown (HELO trinity.anyware-tech.com) (217.112.237.100) by daedalus.apache.org with SMTP; 4 Feb 2004 17:50:23 -0000 Received: (qmail 5219 invoked from network); 4 Feb 2004 17:50:21 -0000 Received: from unknown (HELO apache.org) (10.1.0.254) by trinity.anyware-tech.com with SMTP; 4 Feb 2004 17:50:21 -0000 Message-ID: <402130DD.7070703@apache.org> Date: Wed, 04 Feb 2004 18:50:21 +0100 From: Sylvain Wallez User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: fr, en, en-us MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: [cforms] new validation: every widget can have a validator Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi peeps, I finally managed to finish the new style of validation we discussed a while ago. This new validation allows *any* widget to have a validator. The immediate effect is that is now outside of since not all widgets have a datatype. The validator interface has also changed, since not all widgets are capable of displaying a validation error. A validator now has the responsibility, if validation fails, to set a ValidationError on the validated widget itself or one of its children. Widgets that accept a validation error implement the ValidationErrorAware interface. The existing validators have been wrapped with an adapter and are therefore still supported, although deprecated. I updated the form1 definition in the samples: moved the validation outside the datatype, and added a validation on the repeater that checks if contact names are disctinct among the different rows. This sample uses a new JavaScriptValidator that allows validator to be written as a JS snippet. Enjoy, Sylvain -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com