cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus Heussen" <heus...@rheinland-online.com>
Subject AW: [Cocoon forms] interaction between definition validation and flow validator
Date Tue, 06 Jan 2004 16:17:08 GMT
Hi!

I use

form.validator = myValidator;

placed before

form.showForm("form.display");


and in my validator function something like this

function myValidator(form) {
	var validationError = new
Packages.org.apache.cocoon.woody.datatype.ValidationError("xxx");
	if (!isDate(form.getWidget("vn_geburtsdatum").getValue(),"dd.MM.yyyy")) {
		form.getWidget("vn_geburtsdatum").setValidationError(validationError);
		return false;
	}
	return true;
}

and this works fine for me. Only if all validations (in descriptor file and
my flow validator function) give true the form is no more redisplayed.

Regards, Markus



> -----Ursprungliche Nachricht-----
> Von: news Im Auftrag von Olivier Billard
> Gesendet: Dienstag, 6. Januar 2004 16:56
> An: users@cocoon.apache.org
> Betreff: [Cocoon forms] interaction between definition validation and
> flow validator
>
>
> Hi cocooners !
>
> I asked a question yesterday, that is maybe not clear, so let me
> explain cleaner.
>
> Cocoon forms offers 2 ways of validating a form : definition
> validation (with
> <wd:validation> in the form def file) and in the flow with the
> validator property of the
> flow form object.
>
> And how can I combine the 2, if it's possible ? I would like to
> use the definition
> validation pour simple validations like required fields or
> min/max, and the flow
> validation in addition, for more complex things like unique
> values control in repeaters,
> or business actions...
>
> My flow validator function begins with :
> <code>
> if (!form.getWidget().isValid()) {
>      return false;
> }
> </code>
>
> But even when the form seems to be valid, isValid() returns
> false, and I can never run
> "business validation" code after the test...
>
> I'm using 2.1.2 version of cocoon.
>
> Thanks,
>
> --
> Olivier BILLARD
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message