On 12/21/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
I don't know the particular Tomahawk components well enough to know whether this (by itself) solves the problem that was originally posed, but this is indeed the sort of scenario that the rendersChildren property was designed to deal with. Pretty much any "container" or "layout" component is going to need to manage the way in which its children are rendered (or even decide if they will be rendered or not). To take a very simple example, consider the standard <h:panelGrid> component ... it needs to intersperse rendering the children with <tr> and <td> elements that provide the grid itself, so this component will return "true" for the "rendersChildren" property.
A component+renderer combination that returns true is simply saying "I take full responsibility for what gets rendered from here on down in the component hierarchy." If you're willing to take that responsibility, then it is legal to do so. Fortunately, it's really easy to do something like what <h:panelGrid> does, without knowing anything about the nature of the child components themselves. All you have to do is scribble out your decorations, then tell the child components to render themselves. They, in turn, will either decide to manage their own children or not, in a recursive process going down the tree.
Craig
I don't know enough to comment on whether having getRendersChildren()
return true is a valid solution to this problem.
abstract boolean getRendersChildren()
Return a flag indicating whether this component is
responsible for rendering its child components.
I'm not sure when it's legal for a component to take responsibility
for rendering its children, and when it's not legal.
I don't know the particular Tomahawk components well enough to know whether this (by itself) solves the problem that was originally posed, but this is indeed the sort of scenario that the rendersChildren property was designed to deal with. Pretty much any "container" or "layout" component is going to need to manage the way in which its children are rendered (or even decide if they will be rendered or not). To take a very simple example, consider the standard <h:panelGrid> component ... it needs to intersperse rendering the children with <tr> and <td> elements that provide the grid itself, so this component will return "true" for the "rendersChildren" property.
A component+renderer combination that returns true is simply saying "I take full responsibility for what gets rendered from here on down in the component hierarchy." If you're willing to take that responsibility, then it is legal to do so. Fortunately, it's really easy to do something like what <h:panelGrid> does, without knowing anything about the nature of the child components themselves. All you have to do is scribble out your decorations, then tell the child components to render themselves. They, in turn, will either decide to manage their own children or not, in a recursive process going down the tree.
Craig

