Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List SAPUI5搜索字段live search未筛选_List_Search_Live_Sapui5 - Fatal编程技术网

List SAPUI5搜索字段live search未筛选

List SAPUI5搜索字段live search未筛选,list,search,live,sapui5,List,Search,Live,Sapui5,我正在XML视图中使用搜索字段 <Page title="Title"> <subHeader> <Toolbar> <SearchField liveChange="onSearch" width="100%" /> </Toolbar> </subHeader> <content> <List id =

我正在XML视图中使用搜索字段

<Page title="Title">
  <subHeader>
      <Toolbar>
        <SearchField
          liveChange="onSearch"
          width="100%" />
      </Toolbar>
    </subHeader>
  <content>
  <List id = "oProductList" items="{/formset}" select="whencliekedonlist" mode="SingleSelectMaster">
  <items>
  <StandardListItem title="{orderno}"
  description="{date}">



  </StandardListItem>
  </items>
  </List>
  </content>

  </Page>
我在screen split app母版页中列出了订单号

现在在livesearch上,我调用这个方法来设置文件服务器

>   debugger;
>     // add filter for search
>     var aFilters = [];
>     var sQuery = oEvt.getSource().getValue();
>     if (sQuery && sQuery.length > 0) {
>       //here name is the field on which the filter has to be done.
>       var filter = new sap.ui.model.Filter("orderno", sap.ui.model.FilterOperator.Contains, sQuery);
>       aFilters.push(filter);
>     }
>  
>  
>      
>     // update list binding
>   
>     var list = this.getView().byId("oProductList");
>     var binding = list.getBinding("items");
>     binding.filter(aFilters);
问题:我没有得到过滤的结果。过滤时什么都没有发生。
我使用odata模型是因为它吗?如果是这样,如何继续?您可以告诉我代码

在应用$filter选项的情况下,对您的服务执行odata请求。您很可能会发现您的服务根本没有进行过滤


您可以通过ABAP代码或在网关中配置UI2 Odata缓存来添加筛选。

我使用了以下语句,利用searchfield的“search”-事件:

             <SearchField 
             search="handleSearch" 
             width="100%" > 
             </SearchField>

用handlesearch搜索我的搜索处理器 我在某处读到liveChange事件默认设置为false/inactive…我认为有一个函数可以用来检查它

             <SearchField 
             search="handleSearch" 
             width="100%" > 
             </SearchField>