title: Apache wicket: Componenet.replaceWith(component) from Linktree.onNodeSelected()
body: <p>I have a linktree for navigation over data which shall replace a component in another div.</p>
  
  <p>For this in the tree I have the treestatelistener implementing </p>
  
  <pre><code>public void nodeSelected(Object node) {
      log.debug("nodeSelected: " + node+ " class: " + node.getClass());
              Component content = new Label("content");
              content.replaceWith(new Label("content", "Hello World"));
          }
      }
  }
  </code></pre>
  
  <p>All I get is the message: </p>
  
  <blockquote>
    <p>"This method can only be called on a component that has already been
    added to its parent."</p>
  </blockquote>
  
  <p>The Label with Id "content" is added to the page on init, so it is there before. What do I do wrong?</p>