Quantcast
Viewing all articles
Browse latest Browse all 4841

Re: set the value in UI5 DropDownBox

Hi Ria,

 

DropDownBox definition:

 

var oModel = new sap.ui.model.json.JSONModel();

  oModel.setData({

  Shift:[

  {Shift:"A"},

  {Shift:"B"},

  {Shift:"C"}],

  editable: true,

  tooltip: "Shift"});

  sap.ui.getCore().setModel(oModel);

 

 

 

  //Drop down box definition

  var oDropdownBox3 = new sap.ui.commons.DropdownBox("DropdownBox3");

  oDropdownBox3.bindProperty("tooltip", "/tooltip");

  oDropdownBox3.bindProperty("editable", "/editable");

  oDropdownBox3.setWidth("50px");

  oDropdownBox3.setModel(oModel);

  var oItemTemplate1 = new sap.ui.core.ListItem();

  oItemTemplate1.bindProperty("text", "Shift");

  oItemTemplate1.bindProperty("enabled", "enabled");

  oDropdownBox3.bindItems("/Shift", oItemTemplate1);

 

 

On select:

var shift =oModelCalc.getProperty("Shift",selectedRow);

oDropdownBox3.setValue(shift);

alert(shift);

 

I am getting the values "A","B" and "C" in the alert.  But it is not changing in the dropdownbox.

Please let me know any other doubts you have.

 

Regards

G.Partheeban


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>