title: How to filter a list via controller in sapui5
body: <p>I am pretty new to SAPUI5 and have a little problem with my App. I set up a Master-Detail Application which shows a list of Customers in the Master View. My goal is to filter this list to any property of my oData Service (I am using the Northwind Webservice).</p>
  
  <p>Here you can see a snippet with the list of my view (MasterView.xml): </p>
  
  <pre><code>&lt;List
              id="list"
              items="{
                  path: '/Customers',
                  sorter: {
                      path: 'CompanyName',
                      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;infoToolbar&gt;
                  &lt;Toolbar
                      active="true"
                      id="filterBar"
                      visible="{masterView&gt;/isFilterBarVisible}"
                      press="onOpenViewSettings"&gt;
                      &lt;Title
                          id="filterBarLabel"
                          text="{masterView&gt;/filterBarLabel}" /&gt;
                  &lt;/Toolbar&gt;
              &lt;/infoToolbar&gt;
              &lt;items&gt;
                  &lt;ObjectListItem
                      type="{= ${device&gt;/system/phone} ? 'Active' : 'Inactive'}"
                      press="onSelectionChange"
                      title="{CompanyName}"
                      numberUnit="{CustomerID}"&gt;
                  &lt;/ObjectListItem&gt;
              &lt;/items&gt;
          &lt;/List&gt;
  </code></pre>
  
  <p>And here is what I have done in my controller (Master.controller.js):</p>
  
  <pre><code>onInit : function () {
              // Control state model
              var oList = this.byId("list"),
                  oViewModel = this._createViewModel(),
                  // Put down master list's original value for busy indicator delay,
                  // so it can be restored later on. Busy handling on the master list is
                  // taken care of by the master list itself.
                  iOriginalBusyDelay = oList.getBusyIndicatorDelay();
              // Tryout Filter
              var equals = FilterOperator.EQ;
              var aFilterFoo = [];
              aFilterFoo.push(new Filter("Country", equals, "Germany"));
              var oBinding = oList.getBinding("items");
              oBinding.filter(aFilterFoo); 
              // End tryout Filter
  
              this._oList = oList;
              // keeps the filter and search state
              this._oListFilterState = {
                  aFilter : [],
                  aSearch : []
              };
  
  
              this.setModel(oViewModel, "masterView");
              // Make sure, busy indication is showing immediately so there is no
              // break after the busy indication for loading the view's meta data is
              // ended (see promise 'oWhenMetadataIsLoaded' in AppController)
              oList.attachEventOnce("updateFinished", function(){
                  // Restore original busy indicator delay for the list
                  oViewModel.setProperty("/delay", iOriginalBusyDelay);
              });
  
              this.getView().addEventDelegate({
                  onBeforeFirstShow: function () {
                      this.getOwnerComponent().oListSelector.setBoundMasterList(oList);
                  }.bind(this)
              });
  
              this.getRouter().getRoute("master").attachPatternMatched(this._onMasterMatched, this);
              this.getRouter().attachBypassed(this.onBypassed, this);
  
          },
  </code></pre>
  
  <p>This was all set up automatically by SAP Web IDE. I only changed the code inbetween the comments //Tryout Filter and //End Tryout</p>
  
  <p>When i want to run my application, debugger says: "Cannot read property 'filter' of undefined" because oBinding is undefined.
  I hope any of you can help me. </p>
  
  <p>Thanks a lot and best regards</p>