incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Böhringer Jochen <>
Subject Duplicated clientIds in Components embedded in Trinidad TreeTable
Date Fri, 01 Dec 2006 13:10:05 GMT


It's the first time I'm developing an own component, so I think my problems have a very simple
solution. I want to develop a component for drag and drop using the dojo toolkit.

But my component is by now very simple. It only renders a div Tag around its children. 

The component is a simple class extending UIComponentBase and only overriding getFamily and
the saveState/restoreState methods.

The renderer is extending javax.faces.render.Renderer and overrides encodeBegin and ecodeEnd
to write the div Tag.

The div tag should get a unique id and I thought the clientId would be the right choice:



      public void encodeBegin(FacesContext context, UIComponent component) throws IOException

            if ((context == null) || (component == null)) {

                  throw new NullPointerException();


            Draggable draggable = (Draggable) component;


            if (draggable.isRendered()) {

                  ResponseWriter writer = context.getResponseWriter();

                  writer.startElement("div", component);

                  writer.writeAttribute("id", draggable.getClientId(context), "clientId");




But if I embed the component (tcc:draggable) in a Trinidad Treetable the div tag is rendered
to the client with the same clientid for all rows in the tree table. What do I have to change
to have a unique id for each row in the table? For tr:outputText it works?!



<f:facet name="nodeStamp">


                             <f:facet name="header">

                                   <tr:outputText value="Name (Level / Total Number of
Children)" />






                                         value="(#{treeNode.depth} / #{treeNode.totalNumberOfChildren})

                                         rendered="#{not treeNode.isVirtual}"/>




                                         value="(#{treeNode.depth} / #{treeNode.totalNumberOfChildren})

                                         styleClass="treeEditorVirtualNodeRowText" /> 





When I have reached a more advanced level of knowledge in component development I hope I will
be able to donate my drag&drop component to tomahawk or Trinidad.




  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message