Erik Hatcher wrote:


If you have a template and simply want to render it, then subclass from BaseComponent and do _not_ override renderComponent. If you need to do rendering yourself, subclass from AbstractComponent instead and implement the abstract method needed for rendering.

I've never seen a case where you needed to have both a template and do rendering in code manually.

Well, I have :)
And I'm writing this so that noone gets the -false- impression that such things aren't doable in Tapestry. Well, it was a case where I wanted to output some complex (and conditional) stuff (html + initialization js) BEFORE wanting to render the components defined in the template file. Maybe, I could have moved everything in the template but this would have required many-many nested Conditionals.
So, I just
- extended BaseComponent,
- overrode renderComponent,
- did my own rendering (using IMarkupWriter for the html and Body for adding initialization js) - and at the very end, placed a call to the BaseComponent's renderComponent to render the template,
using super.renderComponent(writer, cycle);

It works :)


    Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to