Skip to Content
-1
Dec 19, 2022 at 02:08 PM

Unable to read table values sap.m.table

341 Views

createtable-view.txt

controller.txt

table.png

Hi All,

I have created a custom UI5 application.

As per the requirement, I have created a sap.m.table. The table is initially empty (all cells blank), wherein the user can add data and save it in the backend table.

On click of Add button, a new blank row is inserted in the table.

I have added the logic to insert a new blank row (function: onAddRow) which is working fine. Also, I have created a new Entity set (ET_CreateDealSet) in the backend Odata project to save the table details in the backend table.

While looping and reading the row data using binding context, I am getting ‘undefined’ error. Hence, not able to fetch the cell value. I tried the following:

// var ScopeItems = this.oScopeTable.getItems();

// var oItem = ScopeItems.getBindingContext().getObject();

// var oItem = items.getItems()[1].getBindingContext().getObject();

// this.oScopeTable.getSelectedItems()[0];

Do I need to bind the newly added row to my model? I am not sure why I am unable to read the cell value here. Please advise.

Regards

Meenakshi

Attachments

controller.txt (662 B)
table.png (30.4 kB)