UI5- Dropdown Box

lightUI5- Dropdown Box

 

 


A simple drop down box with 4 items

1


2


3


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”);


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s