Re: Validation and d2wcontext?
Re: Validation and d2wcontext?
- Subject: Re: Validation and d2wcontext?
- From: Ramsey Gurley <email@hidden>
- Date: Thu, 16 May 2013 08:09:33 -0700
You shouldn't do that. Validation is for validating model logic. If something changes based on the task, that is control logic.
If you have a distinct class of objects that work differently, then you should use inheritance.
If it isn't a distinct class, then you might do some model validation based on associated user roles or something.
But just saying, "Oh, this is an edit page, do one thing. This is a create page, do something else." is the wrong way to use EOF validation. Note, in this case, you could still have model logic based on eo.isNewObject, which makes sense.
Ramsey
On May 16, 2013, at 6:30 AM, James Cicenia wrote:
> Hello -
>
> I want my validation logic to change depending on the "task" of my context.
>
> The question is, how does one do this? Since my validationAttributeKey
> method is in the modeled entity, how can I grab d2wcontext() ?
>
> Or is there a way to change the validation via rules?
>
> Thanks
> James
> _______________________________________________
> 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