Hi, Try to prefix the generated id from context.getViewRoot().createUniqueId() with something else.
Mathias > -----Original Message----- > From: Mario Ivankovits [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 07, 2005 9:35 AM > To: MyFaces Development > Subject: 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 > >
