You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mario Ivankovits <ma...@ops.co.at> on 2005/07/07 09:34:31 UTC

tree2 expand/collapse graphic and HtmlRenderUtils.writeIdIfNecessary

Hi!

I currently prepare a patch for the tree2 component to correctly encode 
the image path for the expand/collapse images.

It already works, but the tree2 element do not toggle the image instead 
I get a javascript error. The javascript cant find the image element.

The reason is in HtmlRenderUtils.writeIdIfNecessary:

In HtmlTreeRenderer a unique ID is generated with 
"context.getViewRoot().createUniqueId()" for the image components. These 
IDs start with "_id".
Now In HtmlImageRendererBase the id is only rendererd "if necessary" and 
HtmlRenderUtils.writeIdIfNecessary decide NOT to render the id due to 
the fact it starts with "_id"

HtmlRenderUtils.writeIdIfNecessary:
if(component.getId()!=null && 
!component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))


Shouldnt a id ALWAYS render be rendered in HtmlImageRendererBase instead 
of using "HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, 
facesContext);"?

---
Mario