Skip to Content
avatar image
Former Member

Data retrieving from newly added table column on xml view

Hi Guys,

I created a simple list type SAPUI5 application. In which, Table data, which is retrieved through odata service, is getting displayed on screen. Now I added one more column through xml view which is actually a input date picker column. When a particular date is chosen in date picker column and press a button (created on xml view) and try to get table data in debugging mode then i get data of those columns which are a part of table itself but i couldn't get data from date picker input field column, which is added through xml view. Code for retrieving data is written below:

here inputDate is id of date picker column.

Did I miss any binding of column with model. Please suggest.Thanks in advance......

var oTable = this.getView().byId("tablegrid");

var oModel = oTable.getModel();

var aItems = oTable.getItems();

var oValuesBookingDate = [];

for( var p = 0; p < aItems.length ; p++) {

oValuesBookingDate[p] = oModel.getProperty("inputDate",aItems[p].getBindingContext());

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 10, 2017 at 01:20 PM

    if you want the new field date, then firstly include that field into the model.

    Then, bind the date property in the model to the column in the table.

    Now, if you pull up the model, the date entered in the column will come to you.

    If you don't want to extend the model, then try to look up the table cell and get the value in the cell.

    Ex: for(int i=0; i<noOfRows; i++{this.byId("<Table ID>").getItems()[i].getCells()[i];}

    Add comment
    10|10000 characters needed characters exceeded

    • In the binding for the table, you would have used a model.

      In that model, there are properties which are mapped to the existing table.

      Now, include a new property date in the existing model.

      Then, in the view definition of the table, bind the new property to the column input/date field.

      Regards,

      Sharath

  • May 10, 2017 at 03:36 PM

    do you have binding for that new column?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jun Wu,

      Actually i simply added that column to table through xml view. I didn't bind that column. Can u suggest how to bind and where to bind?

      Regards

      Sukhram Bhamboo