title: How add a onClick method to a TextField (ExtJS Framework)?
body: <p>I would like to know how to add an onClick() method to a Ext.form.Text component. </p>
  
  <p>If the component is a button, then all I have to do is to add this line:</p>
  
  <pre><code>handler: function() {alert("Hello!");}
  </code></pre>
  
  <p>But that line doesn´t work if the component is a textfield. Look at the example below:</p>
  
  <pre><code>Ext.create('Ext.form.Panel', {
      title: 'Contact Info',
      width: 300,
      bodyPadding: 10,
      renderTo: Ext.getBody(),
      items: [{
          id: 'myButton',
          xtype: 'textfield',
          name: 'name',
          fieldLabel: 'Name',
          style: 'background-color: #ddd;',
          allowBlank: false,
          handler: function() {Ext.getCmp('myButton').setValue("TEXT")} // Does not work!
      }, {
          xtype: 'button',
          name: 'email',
          fieldLabel: 'Email Address',
          style: 'background-color: green',
          textfieldStyle: 'background-color: green',
          handler: function() {Ext.getCmp('myButton').setValue("TEXT")} // Works!
  
      }]
  });
  </code></pre>