SAPUI5:没有选项可以在XML视图中创建动态过滤器? [英] SAPUI5: No options to create dynamic filters in XML views?

查看:249
本文介绍了SAPUI5:没有选项可以在XML视图中创建动态过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将OData模型绑定到列表的项目,并尝试在XML视图中使用以下语法动态应用过滤器:

 < code $< List 
id =supplierList
items ={
path:'/ SupplierCollection',
filters:{
path:' CompCode',
operator:'EQ',
value1:{
path:'general> / companyCode'
}
}
}

这里使用的general模型已经在Component.js中定义,并且在控制器中也被引用
$ b $ pre $ onInit:function(){
...
var generalModel = sap.ui 。.getCore()getModel( 一般);
this.getView()。setModel(generalModel,general);
...
}

不幸的是,模型似乎并不被解析并且在运行时不能正确解释路径。但是,如果我硬编码的价值1,那么过滤器正常工作。



这个问题有什么想法吗?

是我使用错误的路径来设置过滤器的值1?或者它是一个bug?

解决方案

列表绑定不支持将动态筛选器值定义为绑定路径< STRONG>。有关详细信息,请查看我的答案,以获取此问题。另请参阅此处所报告的git问题。


I am binding an OData model to the items of a list and try to apply a filter dynamically using the following syntax in an XML view:

<List
    id="supplierList"
    items="{
        path : '/SupplierCollection',
        filters : {
            path : 'CompCode',
            operator : 'EQ',
            value1: {
                path : 'general>/companyCode'
            }
        }
    }"

The "general" model used here has been defined in the Component.js and is also referenced in the controller of the view:

onInit : function() {
    ...
    var generalModel = sap.ui.getCore().getModel("general");
    this.getView().setModel(generalModel, "general");
    ...
}

Unfortunately, the model doesn't seem to be parsed and the path is not interpreted correctly at runtime. But if I hard-code the value1 then the filter works properly.

Any idea on this issue?

Is it me using a wrong path to set the value1 of the filter? Or is it a bug?

解决方案

The list binding does not support defining dynamic Filter value as a binding path. For details,please check my answer for this question. Also see the reported git issue at here.

这篇关于SAPUI5:没有选项可以在XML视图中创建动态过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆