[Seaside] Forms and call:

Jim Menard jimm at io.com
Mon May 19 15:24:02 CEST 2003


Avi,

I am indeed using Seaside 2.2.1. I'll upgrade soon.

[snip]

> Or maybe you're talking about the fact that the main
> component is inside a WAContainer?  This is a 2.2ism that's no longer
> necessary, but just ask if you still want it explained...

That's indeed what I meant. Since I will upgrade to 2.3, no explanation 
is needed.

> Anyway, the approach of using a "frame" component is almost certainly 
> what
> you want.  WSMFrame is a little more complicated than necessary 
> because it
> dynamically changes the navigation options based on the currently 
> showing
> main component, but you'll probably want the same basic structure.
>
> What you were saying about the search page calling the results page
> calling the individual item page allows me to make a small style point.
> There are two ways you could set that up.  The first is the more 
> typical
> web app way of chaining the three pages together, where each one knows 
> the
> next link - so the search page, when done, would call the results page,
> and so on.  This would look something like this:
>
> SearchPage>>searchButton
>   results := self performSearch.
>   self call: (ResultsPage new results: results).
>
> ResultsPage>>itemLink: someItem
>   self call: (DetailView new item: someItem)
>
> DetailView>>okButton
>   self goto: (Home new).

Yes, I have something like that.

> Hopefully you can understand what I'm getting at from that skeleton.
> The other, and IMO much better way of doing things is to have each page
> #answer the relevant data, and have a method somewhere else that 
> strings
> them all together.  This would look more like:
>
> SearchPage>>searchButton
>   results := self performSearch.
>   self answer: results
>
> ResultsPage>>itemLink: someItem
>   self answer: someItem
>
> DetailView>>okButton
>   self answer
>
> Home>>performSearch
>   results := self call: SearchPage new.
>   item := self call: (ResultsPage new results: results).
>   self call: (DetailView new item: item).

What if the path is not that linear? For example, categories contain 
sub-categories and items. The search takes you to either a single item 
if there is only one match) or to a list of items if there are multiple 
matches. The item view page lets you go to the category. The category 
lets you go to the parent category, any of the items in the category, 
or any sub-category.

> In 2.3, you could also create a WATask subclass that had the code in
> #performSearch as its #go method; you could then embed or call this as 
> a
> component from anywhere, and the search process would kick off.

Ill take a look at that.

> I don't know which way you were picturing doing things, but I thought 
> it
> was worth mentioning.

Thank you for your advice and time.

Jim
--
Jim Menard, jimm at io.com, http://www.io.com/~jimm/
"I want to be remembered as someone who's not dead."
     -- Christine Peterson



More information about the Seaside mailing list