Re: cannot catch NSValidation.ValidationException
Re: cannot catch NSValidation.ValidationException
- Subject: Re: cannot catch NSValidation.ValidationException
- From: Chuck Hill <email@hidden>
- Date: Wed, 9 Mar 2005 11:33:53 -0800
On Mar 9, 2005, at 2:37 AM, Dumitru Husleag wrote:
Hello everybody,
I have validateKey() methods in an EnterpriseObject. The code gets
caled (I see in the console the ERXLogger message : "Validation failed
on an object ...").
My code looks like this:
<code>
try{
ec.saveChanges();
}
catch(Throwable x){
setErrorMessage(x.getMessage());
}
</code>
The problem is I do not get an exception here.
No, you don't. The validation happens during the takeValues phase.
The exceptions are passed to your page in the WOComponent method:
public void validationFailedWithException(Throwable t,
Object value,
String keyPath)
Called when an Enterprise Object or formatter failed validation during
an assignment. The default implementation ignores the error.
Subclassers can override to record the error and possibly return a
different page for the current actio
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden