title: SAPUI5 filter Table dynamically on initialization with odata v4
body: <p>I created a view in sap hana that I expose using odata v4 and this part is working well.</p>
  <p>Now I'm trying to add a table in the details page of a worklist using the data from my view filtered by the ID of the object I display in the details page.</p>
  <p>What I have tried so far is to do in directly in XML by doing that :</p>
  <pre><code>&lt;Table  id=&quot;historyTable&quot;
      inset=&quot;false&quot;
      items=&quot;{
          path: '/wfl_comment',
          parameters : {
              $filter: 'INSTANCE_ID eq ${ID}'
          }
      }&quot;&gt;
  </code></pre>
  <p>But as I found in SAPUI5 documentation it's not possible to do it dynamically in the XML.</p>
  <p>So I tried to filter in the controller following this <a href="https://sapui5.hana.ondemand.com/sdk/#/topic/5338bd1f9afb45fb8b2af957c3530e8f" rel="nofollow noreferrer">documentation</a> and this <a href="https://sapui5.hana.ondemand.com/sdk/#/entity/sap.ui.core.tutorial.odatav4/sample/sap.ui.core.tutorial.odatav4.04/code" rel="nofollow noreferrer">sample</a> from SAPUI5 by adapting <code>onSearch</code> function of the sample in my <code>onInit</code> function.</p>
  <p>My XML:</p>
  <pre><code>&lt;Table  id=&quot;historyTable&quot;
          inset=&quot;false&quot;
          items=&quot;{
              path: '/wfl_comment'
          }&quot;&gt;
  </code></pre>
  <p>My controller.js</p>
  <pre><code>onInit : function () {
      var oViewModel = new JSONModel({
              busy : true,
              delay : 0,
              synchronizationMode : &quot;None&quot;
          });
      this.getRouter().getRoute(&quot;object&quot;).attachPatternMatched(this._onObjectMatched, this);
      this.setModel(oViewModel, &quot;objectView&quot;);
              
      let oView = this.getView();
  
      let sValue = oView.byId(&quot;ID&quot;).getValue();
  
      let oFilter = new Filter(&quot;INSTANCE_ID&quot;, FilterOperator.EQ, sValue);
  
      oView.byId(&quot;historyTable&quot;).getBinding(&quot;items&quot;).filter(oFilter, FilterType.Application);
  }
  </code></pre>
  <p>Here because of the instantiation of <code>oFilter</code> I get the following error :</p>
  <p><code>The following error occurred while displaying routing target with name 'object': Error: Synchronization mode must be 'None' - </code></p>
  <p>But in my manifest.json I set Synchronization mode to None. Here is the models:</p>
  <pre><code>&quot;models&quot;: {
      &quot;i18n&quot;: {
          ...
          }
      },
      &quot;&quot;: {
          &quot;dataSource&quot;: &quot;mainService&quot;,
          &quot;preload&quot;: true,
          &quot;settings&quot;: {
              &quot;operationMode&quot;: &quot;Server&quot;,
              &quot;groupId&quot;: &quot;$direct&quot;,
              &quot;synchronizationMode&quot;: &quot;None&quot;,
              &quot;autoExpandSelect&quot;:true
          }
      }
  }
  </code></pre>
  <p>I also tried to set a static value instead of <code>sValue</code> when I instantiate <code>oFilter</code> but it's not working either.</p>
  <p>How can I fix this error ? and is it the right way to filter the data for a Table that I only want to filter once during the initialization ?</p>