title: Get model in the controller
body: <p>In a SAPUI5 application, I'm using the function onBeforeRendering in the controller to update the view right before it's shown.</p>
  
  <p>In the function, I tried to get the path using:</p>
  
  <pre><code>var sPath = evt.getSource().getBindingContext().getPath();
  </code></pre>
  
  <p>But it's telling me that evt.getSource().getBindingContext() is undefined.
  But I need it to get the model.</p>
  
  <p>Usually I get the model like this:</p>
  
  <pre><code>var data = this.getView().getModel().getData(sPath);
  </code></pre>
  
  <p>But now I can't because I can't get the path.</p>
  
  <p>With:</p>
  
  <pre><code>var data = this.getView().getModel().getData();
  </code></pre>
  
  <p>It's not working either (null).</p>
  
  <p>However, in the console I'm able to get the model using:</p>
  
  <pre><code>var data = this.getView().getModel().oData;
  </code></pre>
  
  <p>But, I know it's not a good thing to do ...</p>