title: SAPUI5 Select first item in list after rendering
body: <p>I have a Master-Detail application and I would like the first list item to be selected automatically once the application is loaded. I have tried the following solution but it does not work:</p>
  
  <pre><code>            onAfterRendering: function() {
  
                var oList = this.getView().byId("bankList");
                var aItems = oList.getItems("listItems");
  
                console.log(aItems);
                  if (aItems.length) {
                      aItems[0].setSelected(true);
                   }
          }
  </code></pre>
  
  <p>The strange thing is that <code>aItems</code> seems to be empty even though it contains the correct details. Below is what is printed in the console when I <code>console.log(aItems)</code>:</p>
  
  <p>The result of <code>console.log(aItems)</code></p>
  
  <p><a href="https://i.stack.imgur.com/QCraQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QCraQ.png" alt="enter image description here"></a></p>