SAP UI5 – 控件
SAP UI5 – 控件
您可以在开发 UI5 应用程序时使用不同类型的 UI 控件。这些控件允许您在 UI5 应用程序中添加按钮、表格、图像、布局、组合框和各种其他控件。
常见的控制类型包括 –
- 简单的控制
- 复杂的控件
- UX3 控制
- 对话框
- 布局
图像控制
Var image = new sap.ui.commons.Image(); Image.setSrc(“Image1.gif”); Image.setAlt(“alternat.text”);
组合框
您可以使用组合框来提供预定义的条目。
属性 – 项目,selectedKey
Var oComboBox2 = new sap.ui.commons.ComboBox (“ComboBox”,{
Items:{path:”/data”,
Template:oItemTemplate, filters:[oFilter]},
Change: function(oEvent){
Sap.ui.getCore(). byId(“field”).setValue(
oEvent.oSource.getSelectedKey());
}
});
简单的按钮控制
使用 attachPresss 为推送操作分配事件处理程序。
Var oButton = new sap.ui.commons.Button ({text : “Click”,
Press: oController.update
});
自动完成控制
自动完成输入的值。
Var uiElement = new sap.ui.commons.AutoComplete({
Tooltip: ”Enter the product”,
maxPopupItems: 4
});
For (var i = 0; i<aData.lenght; i++){
uiElement.addItem(new sap.ui.core.ListItem(
{text: aData[i].name}));
}
工作台控制箱
它派生自 sap.ui.table 并且每个表都包含列。
Var oTable = new sap.ui.table.Table({
Columns: [
New sap.ui.table.Column({
Label: new sap.ui.commons.lable({ text: “First Column”}),
Template: new sap.ui.commons.TextView({ text: “{Firstcolumn}” }),
Width: “120px”
})