cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: how to do form custom validators
Date Tue, 25 May 2004 23:07:48 GMT
On 26.05.2004 00:53, Benoit Deshaies wrote:

> I looked at the sample you posted Vadim. I have a question and a
> comment regarding validation using <fd:javascript>. In those JS
> snippets, can you access the cocoon object (like session) and can you
> load your own Java classes (Packages.com.xyz.Object)?
> 
> And my comment is this: for simple forms, including the validation
> rules such as which fields are required in the form definition itself
> is probably fine. But on larger applications with complex validation
> logic (think income tax report), people are likely to implement some
> sort of external validator component. My concern is that by including
> the validation code in the form definition, you're mixing the
> presentation and business layer. In that respect, I preferred the
> old-style JS validation function, which correctly put the business
> logic out of the presentation layer.

Nobody prevents you from doing it that way, you still can readd this for 
your use case. But this is no longer the default way for doing simple 
field validation. It was really just only a javascript hack. Even for 
your business logic validation you can probably find better ways to 
handle it.

Joerg

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


Mime
View raw message