Sapui5 页面加载后getBinding不工作

Sapui5 页面加载后getBinding不工作,sapui5,Sapui5,getBindin函数出错。我必须在页面加载后立即筛选数据。我制作了一个拆分应用程序,在母版页中,用户单击用户名后,所有详细信息都显示在detailsPage中。此代码用于detailsPage。我收到以下错误 TypeError:无法读取未定义的属性“getBinding” return Controller.extend("com.Second.SecondProject.controller.SecondPage", { onInit: function () {

getBindin函数出错。我必须在页面加载后立即筛选数据。我制作了一个拆分应用程序,在母版页中,用户单击用户名后,所有详细信息都显示在detailsPage中。此代码用于detailsPage。我收到以下错误

TypeError:无法读取未定义的属性“getBinding”

return Controller.extend("com.Second.SecondProject.controller.SecondPage", {
    onInit: function () {
        var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
        oRouter.getRoute("DetailsPage").attachMatched(this._onObjectMatched, this);
    },
    _onObjectMatched: function (oEvent) {
        var selectedArguments = oEvent.getParameter("arguments");
        var selectedRecord = selectedArguments.value;
        console.log(selectedRecord);
        var oList = sap.ui.getCore().byId("UserList");

        var oBinding = oList.getBinding("users");
        console.log(oBinding);
        var aFilter = [];
        aFilter.push(new Filter("name", FilterOperator.Contains, selectedRecord));
        oBinding.filter(aFilter);
        // var obj = {
        //  "Objects": selectedRecord
        // };
        // var navigationobjModel = new JSONModel();
        // navigationobjModel.setData(obj);
        // this.getView().setModel(navigationobjModel, "users");
    }
});

}))

通过错误消息,您似乎没有在数据绑定中遇到问题,而是无法使用
sap.ui.getCore().byId
获取列表

假设您有一个XML视图或使用
createId
方法创建了ID,您应该使用方法
this.byId()
this.getView().byId()
来获取列表

提示:通常当您出现错误时,如
无法读取未定义的属性“XXX”
通常错误在XXX之前使用的变量中

由于
oList
变量未定义,您将收到此错误。

可能存在重复的