You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Leonardo Uribe <lu...@gmail.com> on 2007/07/20 21:16:34 UTC

Re: [TRINIDAD] Decoupling Renderers (PanelFormLayoutRenderer and LabelAndMessageRenderer)

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

Re: [TRINIDAD] Decoupling Renderers (PanelFormLayoutRenderer and LabelAndMessageRenderer)

Posted by Adam Winer <aw...@gmail.com>.
Sorry I haven't been able to help here - this would be great
work, but it's also non-trivial, and I haven't had the time
to help out.  Can any of the other committers help
Leonardo out?

-- Adam


On 8/8/07, Leonardo Uribe <lu...@gmail.com> wrote:
> Any suggestions about refactoring some trinidad components?
>

Re: [TRINIDAD] Decoupling Renderers (PanelFormLayoutRenderer and LabelAndMessageRenderer)

Posted by Leonardo Uribe <lu...@gmail.com>.
Any suggestions about refactoring some trinidad components?