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

Philippe Marschall philippe.marschall at gmail.com
Sun Apr 20 09:37:12 UTC 2008


2008/4/20, Squeaker <squeakman at gmail.com>:
> 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?

No, the announcement would capture all the necessary information, in
this case the child.

Cheers
Philippe

>  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,
>  Frank
>
>
>  _______________________________________________
>  seaside mailing list
>  seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list