title: Cannot read property 'byId' of undefined when calling function through another controller
body: <p>I have two controllers and one XML file. I want to call a function of the second controller from the first controller. The function is supposed to change the text of the xml file associated with the second controller. </p>
  
  <p>This is how I'm calling the function of the second controller from the first: </p>
  
  <pre><code>sap.ui.controller("project.controller.one").set("pancakes");
  </code></pre>
  
  <p>This is the function in the second controller:</p>
  
  <pre><code>set: function (text) {
      alert(text);
      this.getView().byId("label0").setText(text);
  }
  </code></pre>
  
  <p>The XML just has a <code>Label</code> with an <code>id</code> of <code>label0</code>. </p>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'byId' of undefined</p>
  </blockquote>
  
  <p>whenever I reach this line:</p>
  
  <pre><code>this.getView().byId("label0").setText(text)
  </code></pre>
  
  <p>However if I place this in the <code>onInit</code> of controller two:</p>
  
  <pre><code>this.getView().byId("label0").setText("bananas")
  </code></pre>
  
  <p>then the label will change to "bananas" with no error. </p>
  
  <p>What am I missing?</p>