SAP UI5 - การควบคุม
มีตัวควบคุม UI หลายประเภทที่คุณสามารถใช้ได้ในขณะพัฒนาแอปพลิเคชัน UI5 การควบคุมเหล่านี้ช่วยให้คุณสามารถเพิ่มปุ่มตารางรูปภาพเค้าโครงกล่องคำสั่งผสมและตัวควบคุมอื่น ๆ ในแอปพลิเคชัน UI5
ประเภทการควบคุมทั่วไป ได้แก่ -
- การควบคุมที่เรียบง่าย
- การควบคุมที่ซับซ้อน
- การควบคุม UX3
- Dialogs
- Layout
การควบคุมภาพ
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());
}
});
การควบคุมปุ่มอย่างง่าย
ใช้ไฟล์แนบกดกำหนดตัวจัดการเหตุการณ์สำหรับการดำเนินการพุช
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”
})