title: How can I get a view in Sencha Touch 2 from within a controller by calling a function automatically generated by the ref config?
body: <p>I have defined a controller in Sencha, that includes a refs attribute referencing my view, yet whenever I call the automatically generated "get" function to get the view, based on the refs attribute, it returns undefined. Here is my example:</p>
  
  <p>I have the following controller in app/controller/Locals.js:</p>
  
  <pre><code>Ext.define('MobileUnion.controller.Locals', {
      extend: 'Ext.app.Controller',
  
      // Base class methods.
      launch: function () {
          this.callParent(arguments);
      },
      init: function () {
          this.callParent(arguments);
      },
  
      config: {
          refs: {
          localsEditorView: 'localseditorview',
      },
      control: {
          localsEditorView: {}
      }
      },
      slideUpTransition: { type: 'cover', direction: 'up' },
      onEditLocalsCommand: function() {
          this.activateLocalsEditor();
      },
      activateLocalsEditor: function() {
          var localsEditorView = this.getLocalsEditorView();
          console.log(localsEditorView);  // Returns "undefined" to console.
          Ext.Viewport.animateActiveItem(localsEditorView, this.slideUpTransition);
      }
  });
  </code></pre>
  
  <p>I have the following view in app/views/LocalsEditor.js:</p>
  
  <pre><code>Ext.define('MobileUnion.view.LocalsEditor', {
      extend: 'Ext.Panel',
      alias: 'widget.localseditorview',
  
      config: {
          html: 'This is the new view which should show up on top!'
      },
  });
  </code></pre>
  
  <p>So, in the above example, if I call <code>this.getLocalsEditorView()</code> from within my controller, I get "undefined" even though I set a refs attribute as <code>localsEditorView: 'localseditorview'</code> and I defined MobileUnion.view.LocalsEditor to include an alias of <code>widget.localseditorview</code>. I feel like I should get the view when I do this.</p>
  
  <p>By the way, I did define the view in the <code>views</code> attribute of my app.js, so that's not it.</p>
  
  <p>Further information: there's no actual error being returned in my webkit console. Just the call to <code>console.log()</code> noted above in my controller returns undefined, rather than the view object.</p>
  
  <p>Question: What do I have to do to make this function return the view, and not undefined? Any help would be appreciated. I've looked to make sure it's not just a typo; it does not seem to be.</p>