[Seaside] component replacement

Avi Bryant avi@beta4.com
Sun, 24 Mar 2002 16:13:03 -0800 (PST)


On Mon, 25 Mar 2002, Kamil Kukura wrote:

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

> But the second jump won't be reached.

Oh, I see.  Now I understand what you mean by "without the continuation".
So what you want is

  parent children at: 'body' put: ...
  self jumpToPage: ...

except with the extra setup that IAComponent>>jumpToPage: does.  So
perhaps we should factor that logic out into childAt:put:, eg

IAPage>>childAt: aKey put: aComponent

  aComponent parent: self; id: aKey; session: session.
  ^ children at: aKey put: aComponent.

IAComponent>>jumpToPage: aPage

  parent ifNil: [super jumpToPage: page]
         ifNotNil: [parent childAt: id put: page.
                   super jumpToPage: self root]

And then your code would become:

  parent childAt: 'body' put: ...
  self jumpToPage: ...

That's what you were thinking, right?  Seems fine to me.
I guess the only thing is that if you're switching every component on the
page at once, why isn't this just

  parent jumpToPage: LoggedOutClass

or some such?  But I don't see offhand why the facility shouldn't exist
for those that really want it.

Avi