Using 'anchor' to point to an already loaded component

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using 'anchor' to point to an already loaded component

bahman
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>

TIA,
--
Bahman Movaqar  (http://BahmanM.com)

ERP Evaluation, Implementation & Deployment Consultant
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using 'anchor' to point to an already loaded component

Philippe Marschall
On Tue, Jun 25, 2013 at 5:05 PM, Bahman Movaqar <[hidden email]> 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

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside