title: Migration from JSF1.2+Facelets TO JSF2, "component with duplicate id" issue
body: <p>I am migrating application from JSF1.2/MyFaces+Facelets TO JSF2.1/MyFaces. I have following template which used to work with JSF1.2/MyFaces+Facelets. </p>
  
  <pre><code>&lt;ui:component&gt;
  &lt;f:subview id="#{id}"&gt;
  .
  .
  
  &lt;script
  function blockLinkClicks(){
      //Disables all the HyperLink Controls to prevent repeated submits
      var allLinks = document.getElementById("#{id}:treeNodeForm").getElementsByTagName('a');
      var count = allLinks.length;
  .
  .
  &lt;/script&gt;
  .
  .
  .
  &lt;h:form id="treeNodeForm"&gt;  
      &lt;h:panelGroup id="treePanelId"&gt; 
          &lt;t:tree2 id="tree2Id" 
              value="#{treeBean.treeModel}" var="node" varNodeToggler="t"
              binding="#{treeBean.component}" clientSideToggle="false" showNav="false"&gt;
              &lt;f:facet name="selectableNode"&gt;
                  &lt;h:panelGrid id="tree2PGridSelNodeId" columns="3" cellpadding="0" cellspacing="0" border="0"&gt;
  .
  .
  .
  </code></pre>
  
  <p>After migration, I am getting the following error:</p>
  
  <p>java.lang.IllegalStateException: component with duplicate id "<strong>mainLeftTree:treeNodeForm:tree2Id:tree2PGridSelNodeId</strong>" found
      at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:100)
      at org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.checkIds(CheckDuplicateIdFaceletUtils.java:116)</p>
  
  <p>I have found similar questions here in SO but I was not able to relate the solutions, with my above issue. I have tried to find solution for many days/hours but could not. </p>
  
  <p>Please help with your advice and pointers that I can try for a fix, as I am not sure if the issue is with f:subview or t:tree2 or jsf2 facelets.</p>
  
  <p>Thank you very much in advance.</p>
  
  <p>Regards,
  Kumar.</p>