Whatever gave you the idea that validationFailedWithException() is called when you saveChanges()? It is only called by validateTakeValeForKeyPath() when it fails, so you need to catch the exception and call it yourself. My guess is that your mandatory property is not shown in the page?

Cheers, Anjo

Am 03.06.2006 um 06:07 schrieb Guido Neitzer:

Hi.

I'm a little bit baffled by the behaviour of my app ...

I have a simple object with a couple of mandatory attributes (properties and relationships). In my component I have the method

        public void validationFailedWithException (
                        java.lang.Throwable exception,
                        java.lang.Object value,
                        java.lang.String keyPath) {

                // do some things

        }

This method is called for each non-relationship property that failed the validation. So far so good, but it is NOT called for the not set mandatory relationships.

I'm using Wonder, my eo is in a child editing context. An exception is thrown:

<er.extensions.ERXValidationException object: <bnr.projectcenter.eo.Project pk:"null">; propertyKey: client; type: MandatoryToOneRelationshipException; additionalExceptions: (<er.e xtensions.ERXValidationException object: <bnr.projectcenter.eo.Project pk:"null">; propertyKey: createdBy; type: MandatoryToOneRelationshipException; additionalExceptions: ()>)> at com.webobjects.eoaccess.EORelationship.validateValue (EORelationship.java:1805) at com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey (EOEntityClassDescription.java:443) at er.extensions.ERXEntityClassDescription.validateValueForKey (ERXEntityClassDescription.java:762) at com.webobjects.eocontrol.EOCustomObject.validateValueForKey (EOCustomObject.java:1339) at er.extensions.ERXGenericRecord.validateValueForKey (ERXGenericRecord.java:574) at com.webobjects.eocontrol.EOCustomObject.validateForSave (EOCustomObject.java:1411) at er.extensions.ERXGenericRecord.validateForSave (ERXGenericRecord.java:610) at projectcenter.extensions.PageLevelEditComponent.saveChanges (PageLevelEditComponent.java:47)

in line 47 in the component I do a validateForSave on the eo.

What can be the reason for that? Any hint?

cug


--
PharmaLine, Essen, GERMANY
Software and Database Development


_______________________________________________
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/krank% 40logicunited.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
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