Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 34548 invoked from network); 4 Feb 2004 22:12:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 22:12:19 -0000 Received: (qmail 92904 invoked by uid 500); 4 Feb 2004 22:12:02 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 92848 invoked by uid 500); 4 Feb 2004 22:12:00 -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 92781 invoked from network); 4 Feb 2004 22:11:59 -0000 Received: from unknown (HELO fep02-svc.swip.net) (130.244.199.130) by daedalus.apache.org with SMTP; 4 Feb 2004 22:11:59 -0000 Received: from apache.org ([80.170.241.39]) by fep02-svc.swip.net with ESMTP id <20040204221204.EGSR17121.fep02-svc.swip.net@apache.org> for ; Wed, 4 Feb 2004 23:12:04 +0100 Message-ID: <40216E34.1020101@apache.org> Date: Wed, 04 Feb 2004 23:12:04 +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: Re: [cforms] new validation: every widget can have a validator References: <402130DD.7070703@apache.org> <402143E6.3060502@gmx.de> In-Reply-To: <402143E6.3060502@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; 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 Joerg Heinicke wrote: > From the form1 sample (shortened): > > > > > ... > for (var i = 0; i < widget.size; i++) { > > Which properties are available here? Obviously widget, but maybe also > form? This would be cool as I can replace the XReporter asserts that I > have problems with. The form is available on each and every widget through "widget.getForm()" or "widget.form" in JS. I also added get/setAttribute on Form that allows passing arbitrary data between the enclosing context (flowscript or action) and the various components operating on the form (validators, event handlers, etc). > ... > row.getWidget("firstname").setValidationError(new > Packages.org.apache.cocoon.woody.datatype.ValidationError("Duplicate > contact name", false)); > > Must we specify > Packages.org.apache.cocoon.woody.datatype.ValidationError() ?? It > seems to be to much typing. What about just setValidationError(String > [, more parameters])? Do we loose flexibility? At the moment there is > only o.a.c.w.validation.ValidationError and the deprecated extending > o.a.c.w.datatype.ValidationError. My plan is to make some of the most useful Woody classes directly visible in the JS snippets. This includes ValidationError, among others. > BTW, shouldn't the sample create a non-deprecated ValidationError? Yeah sure. This is the first commit of this new feature, which needs some polishing. The deprecated ValidationError remains from the various code iterations. 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