• 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: Chuck Hill's quite good Practices, WOWODC 08
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Chuck Hill's quite good Practices, WOWODC 08
      • From: Chuck Hill <email@hidden>
References: 
 >Re: Chuck Hill's quite good Practices, WOWODC 08 (From: Chuck Hill <email@hidden>)
 >Re: Chuck Hill's quite good Practices, WOWODC 08 (From: Miguel Angel Torres Avila <email@hidden>)
 >Re: Chuck Hill's quite good Practices, WOWODC 08 (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: WebObjects apps in war; maven; where is ERXServletAdaptor; etc.
  • Next by Date: ERAttachmentProcessor file upload
  • Previous by thread: Re: Chuck Hill's quite good Practices, WOWODC 08
  • Next by thread: Re: Chuck Hill's quite good Practices, WOWODC 08
  • Index(es):
    • Date
    • Thread