[Seaside] #render: and #children. What if I don't?

Mariano Martinez Peck marianopeck at gmail.com
Thu Oct 16 22:59:09 UTC 2014


On Thu, Oct 16, 2014 at 5:16 PM, Johan Brichau <johan at inceptive.be> wrote:

> As far as my knowledge goes about this part of the Seaside framework,
> #children is important in:
> - a WATask [1]
>

Ohhh that sounded a bell. It might have been that in my case.


> - when you don’t override renderContentOn: (falling back to the default
> behavior of rendering the children)
>


OK, I don't do this.


> - in combination with #states when you want to support state backtracking
> with the back button
>
>
mmmm I thought only #states was needed for the backtracking with
continuations. So....do I need both then?
Esteban, I was about to answer you this....


> FWIW, I know and have many components that don’t declare their children
> and it works fine. Of course, I’m not using any of the above in those cases.
>

Thank you both.


>
> Johan
>
> [1] http://book.seaside.st/book/components/tasks/sequencing-components
> On 16 Oct 2014, at 18:43, Mariano Martinez Peck <marianopeck at gmail.com>
> wrote:
>
> Hi guys,
>
> From what I understand, if we have a component called X which, as part of
> the #renderConentOn: (or derivative), does:
>
> ComponentX >> renderContentOn: html
> html render: self componentY
>
> Then we need to add componentY to the #chidlren:
>
> ComponentX >> children
> ^ Array with: self componentY
>
> So..not the question is...it seems in some places I forgot to add it to
> #chidlren and the component still render correctly. At the same time, I
> remember once I was fighting to find a bug and it was exactly because I
> forgot to add the component to #children. So... what exactly happens if I
> DON'T add the component as a #children? What does it get broken?
>
> The second question is...is a bit of a pain the #children. Why? Because I
> must store the component somewhere...which I may not requiere that. For
> example, if I have this code:
>
> html render: (MyWebMessageComponent new errorMessage: 'Problem with xxxx';
> yourself)
>
> then I must define an instVar for that component, assign to it before
> render, and then render...
>
> so the second question is...for this type of component that I render only
> "once" (the component is instantiated as part of the rendering phase and
> dead after), do I also have to add it to #children?
>
> Thanks in advance for any clarification.
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>  _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20141016/95431e65/attachment.htm


More information about the seaside mailing list