0
我想创建一个页面,需要一个面板与过滤列表里面。面板内SAPUI5过滤列表
我以前是“组”和“系统”单独的JSON文件,但是然后将它们合并为一个。
这是我的新的JSON文件:
{
"TECHOPSSet" : [
{
"GROUP" : "1",
"SYSTEMS": [
{
"SysID" : "sys1",
"SysDesc" : "System1",
"Availability" : "1",
"Performance" : "1",
"Exception" : "3",
"Configuration" : "2"
}
]
},
{
"GROUP" : "2",
"SYSTEMS": [
{
"SysID" : "sys2",
"SysDesc" : "System2",
"Availability" : "1",
"Performance" : "1",
"Exception" : "3",
"Configuration" : "2"
},
{
"SysID" : "sys3",
"SysDesc" : "System3",
"Availability" : "2",
"Performance" : "1",
"Exception" : "2",
"Configuration" : "3"
}
]
},
{
"GROUP" : "3",
"SYSTEMS": [
{
"SysID" : "sys4",
"SysDesc" : "System4",
"Availability" : "1",
"Performance" : "1",
"Exception" : "1",
"Configuration" : "1"
},
{
"SysID" : "sys5",
"SysDesc" : "System5",
"Availability" : "2",
"Performance" : "2",
"Exception" : "3",
"Configuration" : "1"
},
{
"SysID" : "sys6",
"SysDesc" : "System6",
"Availability" : "1",
"Performance" : "1",
"Exception" : "2",
"Configuration" : "3"
}
]
},
{
"GROUP" : "4",
"SYSTEMS": [
{
"SysID" : "sys7",
"SysDesc" : "System7",
"Availability" : "1",
"Performance" : "1",
"Exception" : "3",
"Configuration" : "2"
}
]
},
{
"GROUP" : "5",
"SYSTEMS": [
{
"SysID" : "sys8",
"SysDesc" : "System8",
"Availability" : "1",
"Performance" : "1",
"Exception" : "3",
"Configuration" : "2"
}
]
}
]
}
这里是我做不工作的视图的片段。我认为必须有“物品路径”,但我不知道如何解决它。
<core:FragmentDefinition xmlns:l="sap.ui.layout"
xmlns:f="sap.ui.layout.form" xmlns:core="sap.ui.core" xmlns="sap.m">
<List id="homelistID" items="{ path: '/TECHOPSSet/GROUP' }" >
<items>
<CustomListItem type="Inactive">
<Panel id="homePanelID" expandable="true" expanded="false" headerText="{GROUP}">
<Toolbar height="2rem">
<Text text="Technical" />
<ToolbarSpacer />
<Text text="Monitoring" />
<ToolbarSpacer />
<Text text="Business" />
</Toolbar>
<List id="techopsListID" items="{ path: '/TECHOPSSet/SYSTEMS'}">
<items>
<CustomListItem type="Active">
<l:HorizontalLayout>
<Image src="{parts: ['Availability', 'Performance', 'Exception'] , formatter: 'sap.ui.proj.util.Formatter.techMonSummary'}" />
<Text text="{SysDesc}" />
<!--<Image src="{parts: ['enter BizOps parts here'] , formatter: 'sap.ui.proj.util.Formatter.bizMonSummary'}" /> -->
</l:HorizontalLayout>
</CustomListItem>
</items>
</List>
</Panel>
</CustomListItem>
</items>
</List>
这里是我的控制器中的一个片段:
onInit : function() {
var homePage = this.getView().byId("homePage");
var oPanelGroup = new sap.ui.model.json.JSONModel(
"model/panelgroup.json");
var oPanelItems = new sap.ui.model.json.JSONModel(
"model/TECHOPSSet.json");
var HomePanel = sap.ui.xmlfragment("sap.ui.proj.fragment.HomePanel");
// sap.ui.getCore().byId("homelistID").setModel(oPanelGroup);
sap.ui.getCore().byId("homelistID").setModel(oPanelItems);
console.log(oPanelGroup);
sap.ui.getCore().byId("techopsListID").setModel(oPanelItems);
console.log(oPanelItems);
homePage.addContent(HomePanel);
},
所以基本上,我如何以这样的方式实现这SAPUI5的“组”是面板和“系统”是该面板中的列表?