[Seaside] dynamic subcomponents proposal
Avi Bryant
seaside@lists.squeakfoundation.org
Fri, 28 Jun 2002 00:27:28 -0700 (PDT)
On Thu, 27 Jun 2002, Tim Rowledge wrote:
> Third, there is the problem endemic to use of wrappers - a component
> that was happily refering to 'parent' now needs help. I chose to fudge
> it by implementing the small number of involved methods in my frame
> class (obviously just delegating to _its_ parent) but I wonder if I
> could simply corrupt the subcomponent's parent oop to point back to the
> 'real' parent component? It might make for all sorts of fun, so I can't
> be bothered to spend time trying to work out any subtle side-effects
> right now.
Sounds like you might find the 'container' trick useful here. This was
added for more or less exactly such situations - messages to container,
which is an inst var of Component, will get delegated up the parent chain
until they find someone who responds to them. I don't use it much, but
every so often you want to refer to a parent who's an indeterminate number
of steps above you.
Cheers,
Avi