Hi Guido,

Thanks for your email.

On 2 Oct 2007, at 18:52, Guido Neitzer wrote:

On 02.10.2007, at 11:29, Catarina Vieira Simoes wrote:

I'd like to use the ERXValidationFactory class to validate forms but I couldn't quite figure how to catch the possible thrown validation exceptions in the action associated with the form. Could you please help me with some informations (and best practices) about how the class works and how to use it to properly validate a generic form.

First of all, I wouldn't start with looking at ERXValidationFactory, but with standard validation methods in WebObjects.
[...]
in your component, collect the errors from there in an array, surround your saveChanges call with a try catch block and show the list of errors on reload.

That's how I'm doing the validation right now, but I was wondering if that functionalities (the error list, etc) aren't already implemented in Wonder. They seem to be in ERXValidationFactory but I really don't quite understand how to use it.


If that works, you can start digging deeper. In your EOs you can throw normal EOValidation.ValidationException objects, you should look at the strings file in ERExtensions for the messages and so on.

A really good help, whether you use Wonder or not, is Chuck's book on that topic.

Chuck's book seems to be the WO bible. :) And it's a great book actually. I'll try to find out more about the validation methods there.

Sincerely,

Catarina Simoes


--
http://velouria.org/writings

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to