[Seaside] Re: Menu component - communicating with root component
philippe.marschall at gmail.com
Sun Apr 20 09:37:12 UTC 2008
2008/4/20, Squeaker <squeakman at gmail.com>:
> Philippe Marschall wrote:
> 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.
> 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,
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside