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 protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/ramseygurley%40gmail.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: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
