Re: Chuck Hill's quite good Practices, WOWODC 08
Re: Chuck Hill's quite good Practices, WOWODC 08
- Subject: Re: Chuck Hill's quite good Practices, WOWODC 08
- From: Tim Worman <email@hidden>
- Date: Wed, 22 Jul 2009 23:02:45 -0700
On Jul 21, 2009, at 5:34 PM, Chuck Hill wrote:
For components that you will use on CommonPage, you will sub-class
CustomComponent as CommonComponent and implement editingContext() as:
public EOEditingContext editingContext(){
return ((CommonPage)context().page()).editingContext();
}
Or, you can allow for components to possibly have their own editing
context (with more than one EC on a page) and implement it like this:
public EOEditingContext editingContext(){
return ((CustomComponent)parent()).editingContext();
}
I've used another approach and now I'd be interested to know if I'd be
branded a fool for it. :-) Since my sub-components often have an EO
passed to them via a binding, I often set the sub-component's editing
context like this:
public EOEditingContext editingContext() {
if(_editingContext == null) {
_editingContext = passedEO().editingContext();
}
return _editingContext;
}
My thought was that I then knew for sure that my subcomponent was
using the same ec as the parent.
These topics are awesome. Thanks Chuck!!
Tim
UCLA GSE&IS
_______________________________________________
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