myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [Trinidad] Triniad 1.2 not using component.encodeAll()
Date Fri, 22 Aug 2008 15:01:07 GMT
encodeAll is a convenience method for renderers to call on their
children, it is not for component authors to extend necessarily.
encodeAll is just a wrapper on the code that is necessary to call
encodeBegin, encodeChildren and encodeEnd.

As the spec says, it is the preferred, not required method, for
developers to *call* (not extend) on child components.

Therefore, Trinidad is compliant with the spec, although not using the
new preferred method.

BTW, why are you overriding an encode method in a component and not in
a renderer? If it is a component that does not render HTML, it would
be best to use either encodeBegin or encodeEnd.

-Andrew

On Thu, Aug 21, 2008 at 3:20 PM, Stephen Friedrich <trinidad@eekboom.com> wrote:
> I just tried to create a very simple custom component.
> It worked exactly iff the parent component is not a Trinidad component.
>
> Turned out that overwriting encodeAll() has no effect in that case, since
> Trinidad's CoreRenderer does not use that method, but rather calls the
> individual
> encodeBegin()/encodeChildren()/encodeEnd() methods itself.
>
> The JSF 1.2 spec says:
> "Add new method, encodeAll(), which is now the preferred method for
> developers to call to
> render a child or facet()."
>
> So I think Trinidad's CoreRenderer (in 1.2) should really use this method,
> right?
>
> Well, ok, IMHO it's a little strange to talk about a "preferred method" in a
> spec.
> I would expect some definitive rules rather than a "would be nice if it were
> done this way".
>

Mime
View raw message