[Seaside] Using 'anchor' to point to an already loaded component

Philippe Marschall philippe.marschall at gmail.com
Wed Jun 26 16:25:22 UTC 2013

On Tue, Jun 25, 2013 at 5:05 PM, Bahman Movaqar <Bahman at bahmanm.com> wrote:
> Hi all,
> Let's say I have a header on the website with a link "Home".  Now,
> obviously, I want this "Home" to point to the root of the application.
> How can I do this?
> Doing the following, certainly -as I've already tried it- will cause an
> infinite recursion :-)
> <code>
>   h anchor
>     callback: [ self parent content: self parent ];
>     with:  'Home'.
> </code>

There is no generic way to do this. Normally your application is
divided into at least three components. A root component with contains
a menu component and a "content component". The menu component
"somehow" sets the "content component" (sometimes the menu is also
rendered by the root component)

root component
 - menu
 - content

Somehow the component containing the component that should change
needs to be notified.

If you have access to the root component you can also try this:

rootComponent call: rootComponent class new

But before you write code like this:

self parent parent parent parent content: Home new

Have a look at announcements [1]

 [1] http://onsmalltalk.com/maintaining-loose-coupling-in-seaside-components


More information about the seaside mailing list