That was what I was thinking of. I hadn't thought of client-side validation, but that's kind of tricky unless you want to extend the form tags and Form classes. If you wanted to automate client-side validation you would have to extend the ActionForm class so that you can provide information about how to validate its fields, and then extend the html:form-related tags to use that info to create javascript or something else to perform the validation. This would be fairly complex unless you're talking about trivial validation (field not empty, numeric value, etc.). Or am I misunderstanding what you mean by "client-side"?

Derek

Jens v.P. wrote:
Hi,

Am Mittwoch, 23.07.03 um 16:24 Uhr schrieb Derek Chen-Becker:

Since the questionnaire is the model for the form, couldn't you just encapsulate a real questionnaire business object within an ActionForm? It adds a layer, but since ActionForms are objects and not interfaces I don't see an easier way than delegation.


I'm not sure I understand that. Do you mean to use the validator "outside" struts (in the business layer) and delegate all validations in the form to the business object? Like this:


MyForm extends ActionForm {
  ..
     public ActionErrors validate(..) {
     ...
     Questionnaire->validate();
     ...
     }
}

That was my first idea, too. But in this case I don't know how to use client side validation (and that's a really nice feature). And it still doesn't solve the problem of dynamically created questionnaires/forms.

I'm thinking about a way to extend/modify the validator for supporting "runtime configuration". I hope that this is not too complicate - I guess that I only have to exchange the digester creation by a runtime configuration. Or by simply "extending" the digester for creating my own "business" classes, adding some features which I require, and add the ability to the business classes (or add a layer between with this ability) to generate the validator framework classes on the fly, based on the extended definition.



Jens


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




--
----------------------------------------------------------------------
Derek Chen-Becker
Senior Network Engineer
CPI Corp, Inc.
1706 Washington Ave
St. Louis, MO 63103
Phone: 314-231-1575 x6014
Fax:   314-613-6724
[EMAIL PROTECTED]
PGP Key available from public key servers
Fingerprint: 1C34 D81E D8A0 641D 6C8C  E952 3B15 693F 9184 BC58
----------------------------------------------------------------------


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



Reply via email to