[Seaside] WADecoration and subcomponents

Julian Fitzell jfitzell at gmail.com
Mon Dec 22 15:44:14 UTC 2008


Yeah, that kind of sucks in 2.8. I think in 2.9 we've got it so that
Decorations can have #children.

In 2.8, you'll need to implement #nextPresentersDo: on your
Decoration. Take a look at WADelegation or WAComponent's
implementation for inspiration.

Julian

On Mon, Dec 22, 2008 at 4:12 PM, Leandro Perez <leandromperez at gmail.com> wrote:
> 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!
> Leandro
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


More information about the seaside mailing list