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: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to