Skip to Content

Problem in destroying table data in SAP UI5 - Routing

I have a split app screen with two master and two detail screen. I have a table in 1st Detail Page. After pressing a button in 1st detail page, I am navigating to second detail page. Here I am doing some actions. But when I navigate from 2nd detail page to 1st detail page(which contains table), table data is not destroying. I tried .setData(null). but still data is there. Kindly suggest some ideas.

Second Detail Page controller code:

onNavBack : function()


var oTable = sap.ui.getCore().byId("__xmlview0--idDetail--prodTable").getModel(); oTable.setData(null);



First Detail Page controller code:

onInit() method:


this.getRouter().getRoute("Detail").attachPatternMatched(this._handleRouteMatched, this);


_handleRouteMatched ()


// odata service call and data binding happens here. //


So when I navigate from second detail screen to first detail screen, the above _handleRouteMatched is called.

Note: I am using Routing for navigation


Karthik S

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 22, 2017 at 02:13 AM

    Get handler to table through - this.getView().byId("idDetail--prodTable").

    Then, try the method - destroyRows. This should remove all the rows in the table.

    Set the debugger in console before the line to destroy and check if the data is actually getting removed.

    Should work.



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2017 at 08:14 AM

    Please use JSONModel binding for the table and set blank array to the JsonModel model when you navigate back to the 1st detail page.

    Add comment
    10|10000 characters needed characters exceeded