[Seaside] How to do the ubiquitous home button?
Avi Bryant
avi at beta4.com
Mon Aug 25 17:18:18 CEST 2003
On Mon, 25 Aug 2003, Pennell, David wrote:
> How would you generalize this for bread crumb trails?
Some notes:
I chatted further just now with Julian about the two different kinds of
bread crumb trails: data structure navigation, back button simulation, and
nesting... no, three. Three kinds of bread crumb trails:
Data structure navigation:
- For example, Yahoo, or the Inspector in Seaside.
- Already supported by WAPath
- Useful when you have a uniform display system (eg each object
knows how to display itself) and the user is allowed to move freely
through the object graph
Back button simulation:
- Useful when you have a linear, wizard-like series of steps.
- Can be done with "bookmark" objects, eg,
go
bookmark1 := self session bookmark.
self step1.
bookmark2 := self session bookmark.
self step2.
"bookmark1 value would take us back to the beginning".
Nesting:
- Sometimes you have a nested hierachy in your site, and you want to be
able to back out to higher levels. The "home" button is a specific case
of this. Usually the drilling down is modelled with #call:, and the
simple case of jumping up a single level is modelled with #answer. So
what we need is a way of answering back multiple levels at once -
essentially, doing a non-local return. For this we want something that
looks more like exception handling (a throw/catch metaphor?). So,
something like this?
HomeComponent>>drillDown
self catch: #home do: [self call: ChildComponent new].
SomeChildOfTheChildComponent>>home
self throw: #home
That would "unwind" any of the component #calls that had been done to get
to that point, until it found the catch for #home.
A simpler way to do the same thing might be something like
self returnTo: HomeComponent
which would unwind until it found something of the appropiate class...
Just throwing out ideas, here.
More information about the Seaside
mailing list