Re: help with a relationship...
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