Skip to Content
avatar image
Former Member

How to read updated items from sap.m.table

Hi all,

I have developed a simple application with the two views.

View 1 bound to EtySet1

<Table id="overtimeItems" width="auto" items="{EtySet1}" updateFinished="onListUpdateFinished"
noDataText="{i18n>detailLineItemTableNoDataText}" busyIndicatorDelay="{detailView>/lineItemTableDelay}" class="sapUiResponsiveMargin">	

and View 2 bound to EtySet2.

<Table id="table" width="auto" class="sapUiResponsiveMargin"
items="{ path: '/EtySet2', sorter: { path: 'Clttx', descending: false } }" >

i have created an association between EtySet1 and EtySet2 so table2 data is populated automatically based on table1 selected line item.

Table 2 is editable table and i want to read the updated content from the table2 and call the odata service with the deep entity call...

//add line item
oHeaderData.EtySet2 = EtySet2 data ?????;
this._oODataModel.create("/EtySet1", oHeaderData, {
	success: function(oData, oResponse) { },
	error: function() { }

with the below logic i was able to get header table data

var oView = this.getView(),
oViewModel = this.getModel("objectView"),
oElementBinding = oView.getElementBinding(),
sPath = oElementBinding.getBoundContext().getPath(),
oObject = oView.getModel().getObject(sPath);

How to get 2nd table data?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 20, 2016 at 08:10 AM

    if model is two way binding mode then you can get second table data same as you did for table1 or using getProperty

    oModel.getProperty(table2 binding path); // may be path would be "headerdata path/EtySet2"



    Add comment
    10|10000 characters needed characters exceeded