-1

SAPUI5 freestyle app using OData v2 and two-way binding.

How do I disable the OData request on page load ?

For example, by default I want there to be no results shown in a List, then when the user choses a filter (or show all), the OData is retrieved.

In Fiori elements, there's an initialLoad property that can be set to enable/disable the loading of OData on a page load. How can this be achieved in a freestyle app?

Adam Harkus
  • 2,050
  • 2
  • 36
  • 64
  • Does this answer your question? [OData Tree binding with filters in a fragment](https://stackoverflow.com/questions/66224382/odata-tree-binding-with-filters-in-a-fragment) – Marc Dec 20 '22 at 14:25
  • Basically you can create the binding as usual in the XML view but set it to `suspended`. Then once you filter you can call `resume` on the binding. Imo this is cleaner than creating templates in your controller. – Marc Dec 20 '22 at 14:26

1 Answers1

0

And the answer is here...

Basically don't bind the items aggregation in the view, bind it manually in the controller:

https://answers.sap.com/questions/13778637/can-the-initial-odata-load-be-disabled-in-a-sapui5.html

Adam Harkus
  • 2,050
  • 2
  • 36
  • 64