Filter UI5 aggregation binding in XML view

妖精的绣舞 提交于 2021-02-11 06:35:41

问题


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">

回答1:


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'
  }
}"


来源:https://stackoverflow.com/questions/50981824/filter-ui5-aggregation-binding-in-xml-view

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!