THI
THI

Reputation: 365

Filter UI5 aggregation binding in XML view

I click a button and navigate to a view where I have a table and am trying to filter. If I enter this : filters: {path: 'ReturnItemFlag' operator: 'EQ' value1: 'Y'} the view fails to load. If I remove that line, it loads.

What can be possibly wrong in this syntax: I am trying to filter the rows in table based on whether the item has "ReturnFlag" = "Y". If it has then I want to display the row.

<table:Table id="T1" class="table" 
    rows="{ path: 'takeStockOrderDetail>/ItemSet/results', filters: {path: 
    'ReturnFlag' operator: 'EQ' value1: 'Y'}, sorter: {path: 'partNumber'}}"   
     selectionMode="Single" selectionBehavior="RowOnly"
     visibleRowCountMode="Fixed" visibleRowCount="7" 
     rowSelectionChange="onRowSelected">

Upvotes: 1

Views: 2781

Answers (1)

Nandan Chaturvedi
Nandan Chaturvedi

Reputation: 1098

Yes, there is an issue with the filters syntax. Filter expects an array of objects which are of type sap.ui.model.Filter.

Here is how you should fix this:

rows="{
  path: 'takeStockOrderDetail>/ItemSet/results',
  filters: [
    {
      path: 'ReturnFlag',
      operator: 'EQ',
      value1: 'Y'
    }
  ],
  sorter: {
    path: 'partNumber'
  }
}"

Upvotes: 1

Related Questions