title: How to set sorter of a List in Controller in SAPUI5?
body: <p>This is basically a workaround trial for the question here : "<a href="https://stackoverflow.com/questions/27081963/how-to-use-custom-sorter-in-xml-views/27092951">How to use custom sorter in XML views</a>"</p>
  
  <p>Since currently it is not possible to use custom sorters in XML views, I thought maybe it is possible to set the sorter in the controller.</p>
  
  <p>How you do that with JS view is like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>var oTemplate = ... // irrelevant
  
  var oList = new sap.m.List({
      id: this.createId("someList"),
      items: {
          path: "/list",
          template: oTemplate,
          sorter: foo.bar.CustomSorter
      }
  });
  </code></pre>
  
  <p>And when I want to convert that to and XML view, I have the following:
  </p>
  
  <pre><code>&lt;m:List id="someList"
          items="{path: '/list'}"&gt;
      &lt;!-- hid ListItem implementation --&gt;
  &lt;/m:List&gt;
  </code></pre>
  
  <p>Then, how can I set a sorter to this list in controller?
  Also, where to hook it? Options:</p>
  
  <ul>
  <li><code>onInit</code></li>
  <li><code>onBeforeRendering</code></li>
  <li><code>onAfterRendering</code></li>
  </ul>
  
  <p>So, what I expected was something like:</p>
  
  <pre class="lang-js prettyprint-override"><code>sap.ui.controller("foo.bar.controller.SomeController", {
     onInit : function(){
        var oList = this.getView().byId("someList");
        oList.get___Something___().setSorter(foo.bar.CustomSorter);
     };
  };
  </code></pre>
  
  <p>but seems not possible.</p>