• 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: help with a relationship...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with a relationship...


  • Subject: Re: help with a relationship...
  • From: Guido Neitzer <email@hidden>
  • Date: Wed, 6 May 2009 10:09:44 -0700

On May 6, 2009, at 8:08 AM, Theodore Petrosky wrote:

- ValidationException e = Please provide a <b>Sub CategoryID</b>.

Is the subCategoryID a class attribute in your model?

Some hints on style though.

Add the current user to the ERXThreadStorage in Session.awake and add some convenience methods to ContactCategory to do the right thing (return the default category), than do something like this:

Override awakeFromInsertion on "Contact":

public void awakeFromInsertion(EOEditingContext editingContext) {
	super.awakeFromInsertion(editingContext);

setContactCategory(ContactCatory.defaultCategory(editingContext));
setContactSubCategory(ContactCatory.defaultSubCategory(editingContext));


	if (ERXThreadStorage.valueForKey("currentUser") != null) {
		setUser(ERXThreadStorage.valueForKey(editingContext, "currentUser");
	}
}

Remember, you are in an object orientated environment and you should put business logic where it belongs: in the model.

cug
_______________________________________________
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


References: 
 >help with a relationship... (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: [Reminder] WOWODC West early bird registration ends May 6th
  • Next by Date: Re: help with a relationship...
  • Previous by thread: Re: help with a relationship...
  • Next by thread: Re: help with a relationship...
  • Index(es):
    • Date
    • Thread