title: Ext JS 4 - how to change content of an item which can't be referenced by an ID
body: <p>I would really appreciate any help with the following problem:</p>
  
  <p>I need to be able to change content of an item (div or textfield) but the problem is that there are going to be multiple instances of the same window so I cannot use div IDs.</p>
  
  <p>I tried this little example:</p>
  
  <pre><code>var myBtnHandler = function(btn) {
      myPanel.items.items[0].html = "Changed by click!";
      myPanel.doLayout();
  }
  
  var fileBtn = new Ext.Button({
      text : 'Change',
      handler : myBtnHandler
  });
  
  var panel1 = {
      html : 'Original content.'
  };
  
  var myPanel = new Ext.Window({
      title : 'How to change it?',
      items : [
          panel1,
          fileBtn
      ]
  });
  myPanel.items.items[0].html = "Changed on load!";
  myPanel.show();
  </code></pre>
  
  <p>Referencing an element by myPanel.items.items[0] works on load but does not work when it's in the button handler - is it a scope-related problem? How to reference an element without its ID?</p>
  
  <p>Thank you very much,</p>
  
  <p>H.</p>