cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Textor <>
Subject Re: AJAX and Cocoon - Design Patterns
Date Wed, 05 Oct 2005 09:25:36 GMT
Derek Hohls schrieb:

>Ah.  .So you were actually saying "you can 
>define a single set of validation criteria _could be_ used to generate 
>whatever validation is performed both client side and server side"
>Obviously, Cocoon only generates the server side validation
>code at present -  but it seems to me there is no reason why one
>cannot write a generic "forms validation Javascript" code generator
>to be distributed as part of future Cocoon releases... this would
>save a *lot* of rework for those wishing to do client side *and*
>server side validation [each has its place, after all].
I think this "generator" might boil down to a stylesheet which is
applied to the CForms def. and converts it to a javascript (text/plain)
- file. It should also contain error messages which could be
internationalized the usual way. Then the validation scenario could be
as follows:

- User clicks "save / update" on a "screen" in the ajax app - where all
fields on that screen form a CForm
- The fields are validated using the JS generated from the Forms def. file
- JS Error message if something went wrong
- If not, client / server trip (the first one!) to store data. Repeat
validation on server to avoid data corruption.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message