Hi Previously, I have tried to separate PanelFormLayoutRenderer and LabelAndMessageRenderer (From this renderer inherits all components that have a label attribute, almost all components). I have added some methods in RenderingContext to manage a RenderDescriptor class, and using a proper interface creating a class that inherits RenderDescriptor and implement the interface to let the parent component render some details of its children.
This point of view is good, and in the practice works (I have rewrite the two rendererers using this and it works good), but I feel there is something wrong with this solution. Thinking more in this topic I have found some things that makes me change of opinion. The big problem is not decouple two renderer, the problem is that LabelAndMessageRenderer do a diferent enclosing HTML tags for a component that has a Renderer that extends from this renderer. A component that is renderer by this renderer, check if it is inside a panelFormLayout, or inside a table, or its surrounded by non friendly container components and in each case do something different. Would have a component to know about its surroundings to do his html tags? (probably adding more complexity doing what I say on the first paragraph) Or it could be better that the surrounding components adds proper html tags to render the enclosing tags for a type of component or another, in order to avoid this strong coupling? (Simpler, but it needs to do a rewrite of some components in trinidad). What do you think about this? Suggestions are welcome. regards Leonardo Uribe
