We have to perform edit functionality where we have to take two scenarios into consideration:
- Make changes in existing entries.
- Add new entries and update the old entries.
In the 2nd scenario, when we are trying to add a new entry, it is getting added to sap.m.Table but if we make any change in the old entry then the newly added line item is disappearing.
let oContextLineItemEntry = oLineItmTab.getModel().createEntry("/EntityName", {
properties: NewLineItem,
});
let oTmp = oLineItmTab.getBindingInfo("items").template,
oItem = oTmp.clone();
oItem.setBindingContext(oContextLineItemEntry);
oLineItmTab.addItem(oItem);
Here NewLineItem is an object which I want to add and it is blank. It is initiated like below:
NewLineItem = oLineItmTab.getItems()[0].getBindingContext().getObject();
After this, I have removed all the values of the objects attribute.
I tried with OData V2 OneWay binding, but it didn't work.
I saw framework behavior is triggering this interaction
onChange startedonChange completed
I went through these questions on SAP Community: