在开发UI5应用程序时,可以使用不同类型的UI控件.这些控件允许您在UI5应用程序中添加按钮,表格,图像,布局,组合框和各种其他控件.
常用控件类型包括 :
简单控制
复杂控制
UX3控制
对话
布局
图像控制
Var image = new sap.ui.commons.Image();Image.setSrc("Image1.gif");Image.setAlt("alternat.text");
Combo Box
您可以使用组合框提供预定义的条目。
属性:items,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()); }});
Simple Button Control
使用attachPresss分配事件处理程序进行推送操作。
Var oButton = new sap.ui.commons.Button ({text : "Click", Press: oController.update});
Autocomplete Control
自动完成输入的值。
Var uiElement = new sap.ui.commons.AutoComplete({ Tooltip: "Enter the product", maxPopupItems: 4});For (var i = 0; iTable Control Box
它是从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" })