title: Vaadin - Add Duplicate Item in Tree
body: <p>I am doing a project in Vaadin 7. In that, I need to add a duplicate Item in a Tree.</p>
  
  <p>I need a tree like this,</p>
  
  <pre><code>+ Person A
      Name
      Age
  + Person B
      Name
      Age
  </code></pre>
  
  <p>But, Vaadin Tree component is not adding the Duplicate item in the tree. It seems like it is overwriting the previous item.</p>
  
  <p>Is it possible to have a tree like above in Vaadin? I use hierarchical container.</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>    Object a = "a";
      Object b = "b";
      Object c = "c";
      Object d = "d";
      Object e = "a";
      Object alphabet = "alphabet";
  
      HierarchicalContainer aHC = new HierarchicalContainer();
      aHC.addItem(a);
      aHC.addItem(b);
      aHC.addItem(c);
      aHC.addItem(d);
      aHC.addItem(e);
      aHC.addItem(alphabet);
      aHC.setParent(a, alphabet);
      aHC.setParent(b, alphabet);
      aHC.setParent(c, alphabet);
      aHC.setParent(d, alphabet);
      aHC.setParent(e, alphabet);
  
      Tree tree = new Tree();
      tree.setContainerDataSource(aHC);
  </code></pre>
  
  <p>Since Object a and e has the same value as 'a'. The tree just skips or replaces it.</p>
  
  <p><strong>Dynamic Code</strong></p>
  
  <pre><code>String[] items = {"alphabet", "a", "b", "c", "d", "a"};
  for(String item : items) {
     Object itemId = tree.addItem();
     tree.setItemCaption(itemId, item);
  }
  </code></pre>
  
  <p>Now how can I set alphabet as parent to all other items?</p>