« Return to Thread: Menu component - communicating with root component

Re: Menu component - communicating with root component

by Squeaker :: Rate this Message:

Reply to Author | View in Thread

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,
Frank

_______________________________________________
seaside mailing list
seaside@...
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

 « Return to Thread: Menu component - communicating with root component