[Seaside] Going back to a known page

Avi Bryant avi@beta4.com
Sat, 25 May 2002 12:05:19 -0700 (PDT)


On Sat, 25 May 2002, Tim Rowledge wrote:

> Now it seems to be ok for my fairly simple structure to use callPage:
> and return: but it doesn't feel like a good general answer somehow. I
> guess another way to put it is 'how do I provide go home button on each
> page'?

I tend to make the "home" button just do something like
self jumpToPage: (HomePage new).  I've never come across a situation where
I actually needed to jump back to existing instances of pages, and I'm
pretty sure it would be a bad idea anyway (given the way backtracking
works, they might not be in the state you left them in).

As for providing it on each page, you probably want to one of these two
things:

- have your entire application live inside a "frame" component that looks
something like

<html>
<h1>Tim's Tremendous Tester</h1>
<page sea:id="mainPane"></page>
<a sea:id="home">Go Home</a>
</html>

where mainPane is where the real action takes place.  Or,

- create a "border" component that looks like

<html>
<h1>Reading and Riting by Rowledge</h1>
[BodyContent]
<a sea:id="home">Homewards</a>
</html>

and then wrap that around the rest of your components like so:

<page sea:id="border">
...
</page>

I'd recommend the first way, but it's good to know about both.