[Seaside] component replacement

Avi Bryant avi@beta4.com
Sun, 24 Mar 2002 14:22:29 -0800 (PST)

On Sun, 24 Mar 2002, Kamil Kukura wrote:

> Now I want to synchronize the body. That is when helper swaps then body
> needs go to home, like by code: self children at 'body' jumpToPage:
> MainClass new. What I'm thinking about now is do everything what
> IAComponent>>jumpToPage: does except that continuation. Is this safe?

I'm not entirely sure what you're asking.  I think what you're saying is
that you have a structure like this:

  |         |
  |         |
 Menu      Body

And you want an action in the menu to control the body, right?  In which
case something like

  (parent children at: 'body') jumpToPage: ...

would work, and yes, would be safe.  But I don't have any idea what you
mean by "everything what IAComponent>>jumpToPage: does except that
continuation".  Can you elaborate?

By the way, a useful pattern for menus/navbars might be to give them a
"target" instance variable, and to bind it from the parent, ie,

  addBindingsTo: template
    (template elementNamed: 'menu')
      set: #target toPath: 'children.body'

And then the code in the menu can simply look like

  target jumpToPage: ...

and the navbar can be more reusable.  Hmm, you may run into problems with
the order in which subcomponents get created, here...

Anyway, does any of this answer your question?