Sapui5 筛选器的SAP UI5绑定问题
我需要根据服务响应动态创建过滤器 控件-sap.ui.comp.filterbar 版本-1.71.4-我不认为版本是个问题。我还尝试了1.81.1(webide的最新版本) fb:control中的组合框未绑定项聚合。不确定我在此处缺少的是什么 看法Sapui5 筛选器的SAP UI5绑定问题,sapui5,Sapui5,我需要根据服务响应动态创建过滤器 控件-sap.ui.comp.filterbar 版本-1.71.4-我不认为版本是个问题。我还尝试了1.81.1(webide的最新版本) fb:control中的组合框未绑定项聚合。不确定我在此处缺少的是什么 看法 <mvc:View controllerName="com.TestIconTabBinding.controller.View1" xmlns:mvc="sap.ui.core.mvc" dis
<mvc:View controllerName="com.TestIconTabBinding.controller.View1" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m"
xmlns:core="sap.ui.core" xmlns:fb="sap.ui.comp.filterbar">
<App id="app">
<pages>
<Page id="page" title="{i18n>title}" showHeader="false" floatingFooter="true">
<content>
<fb:FilterBar filterGroupItems="{oMasterModel>/allFilters}" advancedMode="true" search="onFilterBarWithSuggestionsSearch">
<fb:filterGroupItems>
<fb:FilterGroupItem groupName="__$INTERNAL$" name="{oMasterModel>label}" label="{oMasterModel>label}" labelTooltip="{oMasterModel>label}"
visibleInFilterBar="true">
<fb:control>
<ComboBox items="{oMasterModel>suggestionItems}">
<!-- <ComboBox items="{oMasterModel>/allFilters/0/suggestionItems}"> this works for testing purposes but I dont need it like this-->
<core:Item key="{oMasterModel>obj}" text="{oMasterModel>obj}"/>
</ComboBox>
</fb:control>
</fb:FilterGroupItem>
</fb:filterGroupItems>
</fb:FilterBar>
</content>
</Page>
</pages>
</App>
</mvc:View>
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/ui/model/json/JSONModel"
], function (Controller, JSONModel) {
"use strict";
return Controller.extend("com.TestIconTabBinding.controller.View1", {
onInit: function () {
var oMasterModel = new JSONModel();
this.getView().setModel(oMasterModel, "oMasterModel");
oMasterModel.refresh(true);
this.loadDataSet();
},
loadDataSet: function () {
var oMasterModel = this.getView().getModel("oMasterModel");
var oDataSet = {
"allFilters": [{
"label": "Filter1",
"suggestionItems": [{
"obj": "001"
}, {
"obj": "002"
}]
}, {
"label": "Filter2",
"suggestionItems": [{
"obj": "003"
}, {
"obj": "004"
}]
}]
};
oMasterModel.setData(oDataSet);
oMasterModel.refresh(true);
}
});
});