[Seaside] jumps and repeats?

Avi Bryant seaside@lists.squeakfoundation.org
Thu, 18 Jul 2002 13:41:07 -0700 (PDT)


On Thu, 18 Jul 2002, Ragnar Hojland Espinosa wrote:

> Basically I have whats below.  ExListCompanies/ExListCompanyLine correctly
> shows a list af company names.  But when I click on one of the links, it
> shows a page with as many "foo"s as companies they were instead of just one.
>
> Which means I'm doing something really wrong :)

<g>
So, when you jump from a subcomponent, just that subcomponent jumps - the
rest of the page stays the same.  This can be really handy, but it's
obviously not what you want here.  Try "self root jumpToPage:
EXViewCompany new" (this will find the top level component and
jump from it instead).

You're seeing foo repeated because there's only one instance of the
subcomponent, it's just shown many times - so when it jumps, the page it
jumps to is also shown many times.

BTW, there's no point in writing
^ self jumpToPage:

since #jumpToPage: will never return.  If you want it to, use #callPage:
instead.

Cheers,
Avi

 >
> ExListCompanies>>html
> ^ '<table>
> 	 <tr sea:id="company/companies">
> 	    <ExListCompanyline sea:id="company"></ExListCompanyLine>
> 	 </tr>
>    </table>'
>
> ExListCompanyLine>>html
> ^ '<td><a sea:id="viewCompany">[name]</a><td>
>    <td>[contactPerson]</td>'
>
> ExListCompanyLine>>viewCompany
> ^ self jumpToPage: (ExViewCompany new)
>
> ExViewCompany>>html
> ^ 'foo'
>