Hi,
as to why does it work, the answer should be simple - almost all
renderers in MyFaces do ALL encoding work in encodeEnd method
(including rendering children).
But what do i wonder more is why page's component tree contains ALL
previously rendered/encoded components.
Wouldn't it make sense to remove non-rendered components from it?
I came across this issue when discussing topic: "TabbedPane does not
validate non-selected tabs in server side tab switching mode (Relaed to
TOMAHAWK-1012 <https://issues.apache.org/jira/browse/TOMAHAWK-1012>)."
Best regards,
Zdenek
Mario Ivankovits napsal(a):
Hi!
In JSF 1.1 I am curious about the javax.faces.renderer.Renderer class in
JSF 1.1, in particular the following piece of code:
public void encodeChildren(FacesContext context,
UIComponent component)
throws IOException
{
if (context == null) throw new NullPointerException("context");
if (component == null) throw new NullPointerException("component");
List children = component.getChildren();
for (int i=0; i<children.size(); i++)
{
UIComponent child = (UIComponent) children.get(i);
if (!child.isRendered())
{
continue;
}
child.encodeBegin(context);
if (child.getRendersChildren())
{
child.encodeChildren(context);
}
child.encodeEnd(context);
}
}
I wonder WHEN are the children rendered if the component returns false
on getRendersChildren here.
And how/why does it work when mixing things, lets say you have
t:div/h:panelGroup/t:div
where t:div returns false on getRendersChildren() and h:panelGroup
returns true.
Is there a simple answer to this?
Ciao,
Mario