UI5- Dropdown Box
A simple drop down box with 4 items
Code Snippet:
// Create a DropdownBox
oDropDownBox = new sap.ui.commons.DropdownBox(“DDB1”);
oDropDownBox.setTooltip(“cities”);
//oDropDownBox.setWidth(“200px”);
oItem1 = new sap.ui.core.ListItem(“city1”);
oItem1.setText(“New Delhi”);
oDropDownBox.addItem(oItem1);
oItem2 = new sap.ui.core.ListItem(“city2”);
oItem2.setText(“Kolkata”);
oDropDownBox.addItem(oItem2);
oItem3 = new sap.ui.core.ListItem(“city3”);
oItem3.setText(“Chennai”);
oDropDownBox.addItem(oItem3);
oItem4 = new sap.ui.core.ListItem(“city4”);
oItem4.setText(“Mumbai”);
oDropDownBox.addItem(oItem4);
oDropDownBox.placeAt(“content”);