0
votes

I have a SAPUI5 app with two views. One overview page with a smart table and a details page that also contains a smart table. When navigating from overview to detail page I am binding the detail view to a context with: oView.bindElement("Product(1)");

In the smart table of the detail view product details should be displayed which are available over a Navigation Property. "Product(1)/ProductDetails"

The problem is that now two sequential backend calls will be triggered. One from the bindElement and the other one is triggert from the smart table.

Is there any possibility to not trigger a backend call when binding the view or can that call be deferred and executed in parallel with the one from the smart table?

1
Do you enable batch "useBatch" for the odata model? sapui5.hana.ondemand.com/#/api/…York Chen
Yes "useBatch" is set to true in the OData modelbearcat1

1 Answers

1
votes

I think it's good to separate the backend calls (not put them in the same batch), so that you can have the detail view ready, without waiting for the Smart Table to retrieve the results of the smart table of the detailed view.

However, if you do want to batch all the backend calls, just have a look on class sap.ui.model.odata.v2.ODataListBinding. It's used by the smart table of the detail page. You can use the parameter batchGroupId to specify that you want the request to be bundled in the specified batch. Use the same batch that the one used in bindElement.

Changing the batch of the Smart Table should be possible in callback routine of onBeforeRebindTable, if you do:

oEvent.getParameter("bindingParams").parameters.batchGroupId = "MyBatch"