• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Validation and d2wcontext?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Validation and d2wcontext?
      • From: David LeBer <email@hidden>
References: 
 >Validation and d2wcontext? (From: James Cicenia <email@hidden>)

  • Prev by Date: finally figured out Joda localdate in JasperReports
  • Next by Date: Re: Validation and d2wcontext?
  • Previous by thread: Validation and d2wcontext?
  • Next by thread: Re: Validation and d2wcontext?
  • Index(es):
    • Date
    • Thread