[Seaside] Styles and Overiding HtmlBuilder

Avi Bryant avi at beta4.com
Thu Mar 27 12:22:40 CET 2003


On Thu, 27 Mar 2003, Keith P. Hodges wrote:

> I found this code - where a more specialised builder is invoked, but
> somehow I have a gut feeling that there should be a more elegant way
> of doing this.

Yeah, there should.  The idea was always that each component could specify
its own renderer (note the #rendererClass method) but this doesn't really
work in 2.2 because you need to maintain a single callback cache, etc,
through the entire component tree, and so the renderer actually only gets
created once (and usually in WAFrame, which you have no control over).

2.3 gets it right by separating out a RenderingContext with the objects
that need to persist through the render, and letting each component wrap
its own renderer around that.  So you can override #renderWithContext:,
which by default looks like

  renderWithContext: aRenderingContext
     self renderAllOn: (WAHtmlRenderer fromContext: aRenderingContext)

to do whatever you like.

Avi



More information about the Seaside mailing list