title: ExtJS: Removing and Readding a FormPanel into a Window
body: <p>I'm having a problem where I would like to remove a FormPanel from a Window.</p>
  
  <p>Here is my Form which is being loaded in a Window:</p>
  
  <pre><code>myForm = new Ext.FormPanel({
      frame: true,
      width: '100%',
      id: 'myform',
      layout: 'form',
      autoHeight: true,
      autoDestroy: false,
      region: 'center',
      monitorValid: true,
      items: [{
          xtype: 'textfield',
          id: 'mytextfield',
          fieldLabel: 'My Label',
  
      }]
   });
  
  MyWindow =  new Ext.Window({
    title: 'MyWindow',  
      layout: 'auto',
      resizable: false,
    width: 717, 
      autoheight:true,
    id:'mywindow',
      closeAction:'hide',
    closable: true,
      items:[Ext.getCmp("myform")]
  
  
    });
  </code></pre>
  
  <p>Now I want to remove this form and have to show another form, and I'm doing like this somewhere else:</p>
  
  <pre><code>MyWindow.removeAll();
  MyWindow.add(Ext.getCmp("myAnotherForm"));
  </code></pre>
  
  <p>But this gives me error <code>"Uncaught TypeError: Cannot read property 'events' of undefined"</code> in ext-all-debug.js.</p>
  
  <p>Is there anything, I'm missing here ?</p>
  
  <p>Thanks.</p>