Re: Testing if an EO would be deletable
Re: Testing if an EO would be deletable
- Subject: Re: Testing if an EO would be deletable
- From: "Cheong Hee (Gmail)" <email@hidden>
- Date: Tue, 19 Jan 2010 18:19:31 +0800
Hi Paul
Interesting. I always do it at the UI level where "delete" button has a
binding with isDisabled. E.g. User is allow to be deleted if his status is
inactive. In this way, the delete button will be enabled if the logic
return !isDisabled, otherwise the button is disabled. I relied much on own
logic checking than EOF to decide if the object is allowed to be deleted,
apart from delete rule. One of the reasons is sometimes the object itself
also depends on its attribute value other than delete rule. Is it not
better to depend on our own delete logic than EOF? Sooorry for being naive.
Cheers
Cheong Hee
----- Original Message -----
From: "Paul Hoadley" <email@hidden>
To: "Apple WO-Dev" <email@hidden>
Sent: Tuesday, January 19, 2010 5:47 PM
Subject: Testing if an EO would be deletable
Hello,
I was just reading Johan Henselmans's thread entitled "validating deleting
an object with relationship", and it reminded me of a similar question I had
recently: is there a convenient way to ask EOF if a particular EO _would be_
deletable if I tried to delete it?
I have a component where I list some EOs, and I want to offer a "Delete"
hyperlink next to only those which would be deletable given the model's
delete rules. Is the easiest way to do this to call validateForDelete() and
see if it throws a ValidationException? I assume that would answer the
question, it just seems a bit clumsy.
--
Paul.
http://logicsquad.net/
_______________________________________________
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
_______________________________________________
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