on 07-21-2023 9:28 AM
I need to setup oData binding in a view so that, by default the items aggregation of a table (containing products) is 'suspended' until I click a button that 'resumes' the binding and loads in the products.
Example is here UI5 Tips: Use of Binding Suspend | SAP Blogs but when I try to apply this to the items aggregation of a table, the resume() does nothing, and no products are shown.
<Table id="productsTable"
items="{path: 'Products', suspended: true }"
onProductSearchAll: function (oEvent) {
const oView = this.getView();
const table = oView.byId("productsTable");
const binding = table.getBinding("items");
binding.resume();
}
For now, the workaround has been to NOT include the items aggregation in the view, and to unbind/bind the items aggregation in the controller.
This is a more cumbersome solution, so would be good to confirm why the cleaner suspend/resume solution fails in this scenario.
I just added an answer at https://stackoverflow.com/a/76809592/5846045. If it helped, please consider removing this duplicate question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can only suspend absolute bindings or bindings which are quasi-absolute.
does your binding satisfy that condition?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
junwu
My data source is...
"dataSources": {
"productService": {
"uri": "/sap/opu/odata/itcp/product_srv/",
"type": "OData",
"settings": {
"odataversion": "2.0",
"localUri": "localService/metadata.xml"
}
}
and the binding is...
<Table id="productsTable"
items="{path: 'Products', suspended: true }"
So what exactly is an absolute/quasi-absolute binding? And does this qualify?
Note* It looks like the resume() is the issue, not the suspend. The suspend appears to work as no oData is returned. The issue is that I can't resume() and load the oData.
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.