[Seaside] I'm not ready to #go
Avi Bryant
avi at beta4.com
Wed Mar 3 02:05:26 CET 2004
On Mar 2, 2004, at 3:50 PM, Esteban A. Maringolo wrote:
> Hello again,
>
> Continuing with my seaside tests, i´ve found some selectors, and
> because
> there are no comments on those selectors, i don't understand the
> purpose and
> semantic of the message.
>
> One of those selector that caught my attention, was #go
>
> I've found it in WATask, WATaskFrame and WAPluggableTask.
>
> If somebody can explain it or give a clue of where to find info about
> this
> (and others) particular selector, i'll appreciate it.
The user interface of a Seaside program is represented by a tree of
WAController objects.
There are two subclasses of WAController. The one you probably have
experience with is WAComponent. Components get rendered as HTML and
provide a concrete, visible piece of the UI.
The other is WATask. Like a Component, a task is responsible for
displaying a particular "chunk" of the page. However, a task never
gets directly rendered as HTML. Instead, a task strings together a
sequence of other tasks or components. There will always be a
currently active component that actually gets rendered.
The #go message is sent when a task is first displayed (called or
embedded). The #go method describes the flow of components that make
up the task.
For example, here's a #go method that uses several calls to standard
components (hidden behind #inform: and #request:).
go
name := self request: 'What is your name?'.
quest := self request: 'What is your quest, ', name, '?'.
color := self request: 'What is your favorite color?'.
color = 'blue'
ifTrue: [self inform: 'You may pass.']
ifFalse: [self inform: 'Wrong!'].
Try embedding a task which implements that method and see what
happens...
To think of it another way: #go is like an action method on a component
that is hooked up to a link, except that in a Task the link is
automatically clicked as soon as the component is shown and so the user
never even sees it. I bring that up because before I implemented Task
that's literally what I would do to emulate it - have a "go" link and
an instant meta-refresh that followed it. That's still more or less
what it looks like to the framework.
Avi
More information about the Seaside
mailing list