Skip to Content
0

How to bind the data to a table in routing?

Jul 28, 2017 at 06:29 AM

49

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded

Please share the minimum working code, so that we can figure out the issue properly.

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Noufal Farah Jul 28, 2017 at 09:36 AM
0

Hello,

Please share your code So we can correct your issue.

Kind regards,

Noufal

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 08, 2017 at 12:32 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Srikanth KV Aug 08, 2017 at 03:58 PM
0

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
    } );
}
Share
10 |10000 characters needed characters left characters exceeded