Skip to Content
0

getting duplicate id error in table when navigating in item list in master screen

Mar 20, 2017 at 03:39 PM

47

avatar image
Former Member

Hi,

Am getting duplicate id error and table data hangs when navigating to item in master screen which has table in detail screen for which row is removed but not saved to backend.Am using odata binding in m.table.I have seen many example to remove selected row from table using splice function but this doesn't work for me since am using odata model.

error is:"Error: adding element with duplicate id '__icon0-__component0---detail--lineItemTable-0'"

Am using the below code to remove a selected row from table:-

deleteRow: function() { var oTable = this.getView().byId("lineItemTable"); var colLsit=this.getView().byId("lineItemColumnList"); var arrLength = this.getView().byId("lineItemTable").getSelectedContexts().length; var oItems = oTable.getItems(); if (arrLength > 0) { for (var j = oItems.length - 1; j >= 0; j--) { if (oItems[j].isSelected()) { oTable.removeItem(oItems[j]); } } } else { MessageToast.show(this.getResourceBundle().getText("selectitem")); } },

thanks for your time

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Mar 20, 2017 at 04:55 PM
0

just delete the record through odata model, the row will be deleted automatically

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 21, 2017 at 07:47 AM
0

Hi,

We have a scenario based on the table rows data,there is calacuation based on which user can either save it or ignore and move to next item in master list.

This error happens only when user move to othe item in master list without saving

Thanks,

Palani

Share
10 |10000 characters needed characters left characters exceeded