[Seaside] WADecoration and subcomponents

Leandro Perez leandromperez at gmail.com
Mon Dec 22 15:12:11 UTC 2008

Hello list,
I have a question regarding the use of WADecoration and how to show
subcomponents inside its rendering phase.

I need to do something like this:

MyComponent >> initialize
        super initialize.
        self addDecoration: MyWADecorationSubclass new.

MyDecorationSubclass >> renderContentOn:html
         self renderOwnerOn:html.
         html render: OtherComponent instance

OtherComponent >> renderContentOn: html
        html render: etc....

MyComponent is decorated with a MyDecorationSubclass instance. When
MyComponent gets rendered, the OtherComponent is also rendered, as part of
the decoration. The visual result is as expected, both the original
component and the decoration are visible. The problem comes with callbacks
(children problem). As the decorated component does not return the
decoration's subcomponent (OtherComponent) as one of its children, callbacks
inside OtherComponent wont work.

I could easily fix this problem if I add the OtherComponent dynamically to
some collection of the decorated component. To be able to do this, the
decorated component cannot be a simple WAComponent, so I wouldn't be able to
decorate WAComponents the way I would like.

My question is:
Is there any way to decorate a WAComponent with a WADecoration and render a
second component inside the decoration's renderContentOn:. In such way that
the second component's callbacks would work ok?

thanks, regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20081222/7a37f43d/attachment.htm

More information about the seaside mailing list