Skip to Content
0
Dec 05, 2018 at 03:08 PM

Newly added table row disappearing when changing previous row

158 Views

Hi Community,

I have a sap.m.Table bound to an entityset in the GW via ODataModel V2. The table displays 3 rows with data from the backend. There is a functionality to add a new row by clicking an add row button in the Table toolbar.

For this I am using the createEntry method as shown in the code below when clicking on the button. This works fine and the entry (row 4) is shown in the table. I can then enter values in the fields for this row.

However, if I now change the data of any of the previous rows, this newly created row (row 4) disappears from the table and I can see only the 3 existing rows. The data for the 4th row is still available in the mChangedEntities of the model. Its just that the newly created row disappears.

Does anyone have a clue how to resolve this ?

Note: The new row is submitted later to the backend using submitChanges.

var oContext = oModel.createEntry("/ManualPostBondsSet", {
				properties : {
					BusinessPartnerID: this._bpId,
				}
		});
var oItem = this._getItemsTemplate(); // Pvt. method to retrieve the ColumnListItem template
var oTable = this.getView().byId(sTableId);
if(oTable) {
	oItem.setBindingContext(oContext, "modelName");
	oTable.addItem(oItem);
}