[Seaside] Re: Menu component - communicating with root component

Squeaker squeakman at gmail.com
Sun Apr 20 02:50:14 UTC 2008

Philippe Marschall wrote:
> http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/

With respect to the example in the link above, it is fine to have one 
child that announces RemoveChild. I cannot figure out how a more complex 
example would work.

Assume a situation where you have a parent (aMenu) that had multiple 
children (like MenuItems in a menu) and each child can announce 
ItemClicked.  Wouldn't the parent code end up looking a huge case 
statement when trying to figure out which child was clicked?

Each child is of he same type (same class) but I want to do something 
different for each instance, i.e., if menuItem1 is clicked I want to do 
something unique to that instance.  How would you do this and avoid a 
monster case statement?

Hope my question is not too badly phrased.

Thanks for any help you can offer on this,

More information about the seaside mailing list