Skip to Content
avatar image
Former Member

How to bind the data to a table in routing?

I'm trying to bind the data to a table while using routing. But somehow the data is not getting binded. I've put a button and on pressing that button data binding is successful. How to bind it without a button?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 28, 2017 at 09:36 AM

    Hello,

    Please share your code So we can correct your issue.

    Kind regards,

    Noufal

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 12:32 PM

    If you want the activity i.e. the binding to be done after a particular event then you need to decide the event.

    If could be on the click of a button or any other event. There are standard hook methods like onAfterRendering etc. You can even choose to perform your binding in these methods but need to be careful as these get called by the framework and not in your control.

    Regards,

    Sharath

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 08, 2017 at 03:58 PM

    I believe you want to bind the table using route instead of button....i.e when you are navigation from one page to another page you want to bind table. If so this can be performed using route match event.

    When user navigates from one page to another page using route an event with the name "routePatternMatched" is triggered where you can perform binding

    In the controller where the table is available write below code

    onInit: function(){
        var oRouter = sap.ui.core.UIComponent.getRouterFor(this);     //get instance of router
        oRouter.getRoute("<your route name>").attachRoutePatternMatched( function(oEvent){
           //set binding for table here
        } );
    }
    
    Add comment
    10|10000 characters needed characters exceeded