We have to perform edit functionality where we have to take two scenarios into consideration:
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 started
onChange completed
I went through these questions on SAP Community:
We had raised an OSS note for this issue to which SAP replied, this is not and issue with UI control but the way to use it. Basically we are not supposed to add new entries when OData binding is being used.