cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding multiple lines in sap.m.Table with deferred request groups

Former Member
0 Likes
1,279

Hi Experts,

I have implemented a very simple app for testing purposes with a simple responsive table containing Usernames and E-Mail Addresses:

The controller logic is very simple, too. It just contains the button event handlers.

The table data is coming from an ABAP Back-End and I used an Odata Model with Two-Way binding to bind the list. When updating single properties of the existing lines (e.g. E-Mail Address) the Back-End update works fine. My Save Button Event handler simply submits all changes (see listing above). Now I want to add several lines at once and submit them all together. No Record in the back-end can be created before at least the key field "Username" was entered by the user. When pressing the "Add" button my logic actually adds new lines:

When I enter new data in these new lines and submit the changes everything is persisted correctly. But: If I apply any changes to the old lines (originally coming from the BE) the lines vanish. I did some debugging and the model update caused by the changes of the existing lines triggers a refresh of the list binding of the table. All table lines that did not come originally from the BE are removed. The same happens when I change the odata service to One-Way Binding and I call any setProperty Method at the model. So, it's not an issue with the Two-Way Binding.

Does anyone have an idea how to overcome this issue?

Regards

Tobias

View Entire Topic
junwu
SAP Champion
SAP Champion
0 Likes

directly adding a line to the table is not supported by odatamodel, if my memory is right.

Former Member
0 Likes

Hi Jun,

Does that actually mean I have to create a single entity in back-end line by line?

Regards

Tobias