Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2823

How to add the data in table select from combo box...??

$
0
0

Hi All,

       

 

          I am working in sapui5 application. there one combo box i want to select one data and display in the table view. Now i can get the data from table but the data is not is displaying in table. Please correct my code.. I share my code snippet here,

 

 

 

 

Code:

 

 

var Instrument = new sap.ui.core.Item({

  text : "{Rcins}"

  });

 

  var slc_dest = new sap.m.ComboBox("slc_dest", {

  placeholder : "Select Instrument",

  items : {

  path : "/results",

  template : Instrument

  },

  selectionChange: function(oControlEvent) {

fin_loc = sap.ui.getCore().byId("slc_dest").getValue();

  if(fin_loc != null)

  {

  alert("Instrument : "+fin_loc);

  var rows = oTablei.getItems();

       var model = oTablei.getModel();

       var data = model.getData();

       data.push({

         Vacancy: "",

       });

       model.setData(data);

       var model = oTablei.getModel();

       var data = model.getData();

  }

  else{

  alert("Please Select the Instrument");

  }

 

  },

  });

 

  var oTablei = new sap.m.Table("oTablei",{

     mode: sap.m.ListMode.None,

     columns: [

       new sap.m.Column({ header: new sap.m.Label({text: "Vacancy"})}),

 

     ],

     items: {

       path: "/",

       template: new sap.m.ColumnListItem({

         cells: [

           new sap.m.Label({ text: "{fin_loc}" }),

 

         ]

       })

     }

   });

  oTablei.setModel(new sap.ui.model.json.JSONModel([]));


Viewing all articles
Browse latest Browse all 2823

Trending Articles



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