[Seaside] Un-calling components

Ramon Leon ramon.leon at allresnet.com
Wed Aug 22 07:36:17 UTC 2007


> On 22/08/07, Ramon Leon <ramon.leon at allresnet.com> wrote:
> > I believe you can simply tell any component #home to remove 
> all decorations.
> > Your sidebar could just do its thing and then call main 
> home.  Maybe I 
> > misunderstand your intentions?
> 
> Ah, thanks, I hadn't discovered #home. I don't think this 
> makes the first part of the method redundant, though -- we 
> only remove the delegates if the user actually clicked a link 
> in the sidebar. Maybe there's also a clean way of doing this?

Well, it depends on if your sidebar has direct access to the main component
or not.  If so, then just directly

SideBar>>renderContentOn: html
    html anchor on: #someAction of: self

SideBar>>someAction
    self blahBlah.
    self mainComponent home.

If not, say they're both siblings of a parent, I'd use an Announcement and
rig up the an announcer in the session and have the root component register
for the announcement.

Root>>initialize
    super initialize.
    self session announcer 
        on: RefreshHome 
        do: [:ann | self mainComponent home]

SideBar>>renderContentOn: html
    html anchor on: #someAction of: self

SideBar>>someAction
    self blahBlah.
    self session announce: RefreshHome new.

Keeps everything nicely decoupled and lets you cause any action in any
component from anywhere in the system.

Ramon Leon
http://onsmalltalk.com



More information about the seaside mailing list