title: UI5 - get the count for each list item in the master section
body: <p>I am very new to SAPUI5. I have a scenario thus:</p>
  
  <p>A master-detail page (from the master-detail template available via SAP Web IDE, views are XML) displays items from my model(mockdata). </p>
  
  <p>The master section is bound to entity <code>Interests</code>. The detail section gets its information from entity <code>Messages</code>. I have referential constraints between them and it works perfectly alright. Tapping on items in my master section displays the corresponding items in the table in the details section.</p>
  
  <p>The master section list:</p>
  
  <pre><code>&lt;List
    id="list"
    items="{
      path: '/InterestsSet',
      sorter: {
        path: 'InterestShortDescription',
        descending: false
      },
      groupHeaderFactory: '.createGroupHeader'
    }"
    busyIndicatorDelay="{masterView&gt;/delay}"
    noDataText="{masterView&gt;/noDataText}"
    mode="{= ${device&gt;/system/phone} ? 'None' : 'SingleSelectMaster'}"
    growing="true"
    growingScrollToLoad="true"
    updateFinished="onUpdateFinished"
    selectionChange="onSelectionChange"&gt;
    &lt;items&gt;
      &lt;ObjectListItem 
        type="{= ${device&gt;/system/phone} ? 'Active' : 'Inactive'}"
        press="onSelectionChange"
        title="{InterestShortDescription}"
        number="{path :'MessagesSet', formatter:'.productCount'}"&gt;
      &lt;/ObjectListItem&gt;
    &lt;/items&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>The Master section needs to display a number value that equals the total number of items that is displayed in Entity <code>Messages</code>(i.e. equal to the number of rows displayed in the details section). After some research (ultimately from <a href="https://stackoverflow.com/questions/23816274/sapui5-how-to-bind-odata-count-to-a-xml-view">SAPUI5 - How to Bind Odata $count to a XML view</a>)i came to know about the <code>formatter</code> property and added it.</p>
  
  <p>My formatter reads thus:</p>
  
  <pre><code>productCount: function(oValue){
      if (oValue) {
        var sPath = this.getBindingContext().getPath() + '/MessagesID';
        var oBindings = this.getModel().bindList(sPath);
        return oBindings.getLength();
      }
  }
  </code></pre>
  
  <p>I tried logging <code>oValue</code>, but it seems to be returning as <code>undefined</code>. </p>
  
  <p>Is there anyway to get the count for each item in the master list.</p>