[Seaside] Re: lightbox: inside child components
squeakman at gmail.com
Sat Apr 19 13:34:01 UTC 2008
Esteban Lorenzano wrote:
> Of course, If I do: self grandParent lightbox: blah, everithing works
> fine (#grandParent does not exist, is just an example... I know is not
> the correct design).
> So, #lightbox: does not work in child components with two levels of
My understanding of your problem is that you have a containment
hierarchy of objects and you want some object deep in the hierarchy to
tell objects higher up that something of interest happened. And to do
this with loose coupling.
The approach that I took to solve this problem was to use Announcements.
When I am building my containment hierarchy (A contains B who contains
C etc) I am careful to have A register for announcements from B. B can
choose to propagate announcements originating from C up to A.
I am not sure if this is the standard way to do things or if it is
correct but it works. The downside is that it takes quite a bit of
setting up - all those Announcements with their #when:do: messages.
What do others think? Is this an acceptable solution? Is there a better way?
More information about the seaside