on 2024 Dec 23 11:01 AM
Hello,
I am trying to change the growing threshold of the object page table in a RAP application using OData v4 (as recommended, to the best of my knowledge).
The annotation @ui.presentationVariant with maxItems is not working. I also tried editing the page in Visual Studio Code through the page editor, but the Growing threshold attribute does not exist (I assume this is because I am using OData v4).
"So be it," I thought. No worries—I can create a controller extension and change this parameter with JavaScript. But no! Controller extensions are not available with OData v4.
Am I missing something? The default growing threshold on the object page is 10, which is quite limited.
Why is OData v4 missing so many features?
Request clarification before answering.
Hi,
i got the same problem and found a solution.
Extend the controller with the guided development.
(The Controller for the Object Page with the Table you want to modify)
Add this code:
⚡Replace the XXXXX with your correct controller name⚡
sap.ui.define([
"sap/ui/core/mvc/ControllerExtension"
], function (ControllerExtension) {
"use strict";
return ControllerExtension.extend("XXXXX.ext.controller.Header_Page_Controller_Extension", {
override: {
onInit: function () {
var oModel = this.base.getExtensionAPI().getModel();
},
onAfterRendering: function () {
var oTable = this._getObjectPageTable();
if (oTable) {
oTable.setGrowing(true);
oTable.setGrowingScrollToLoad(true);
oTable.setGrowingThreshold(50);
}
}
},
_getObjectPageTable: function () {
var oView = this.getView();
var aTables = oView.findAggregatedObjects(true, function (oControl) {
return oControl.isA("sap.m.Table");
});
return (aTables && aTables.length) ? aTables[0] : null;
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.