on 08-12-2021 7:49 AM
Hi Experts,
I'm using SAPUI5 Fiori List Reports based on List Report Templates and CDS with ValueHelps via CDS Annotation.
My requirement is to change the ValueHelp Table Title from SAP standard "Items" to something meaningful.
I managed to set the Title to "Periods", but the counter does not work (should be "Periods (123)").
ValueHelp before with Table Title "Items":
ValueHelp after with Table Title "Periods":
Code:
onInitSmartFilterBarExtension: function (oEvent) {
var oSmartFilterBar = oEvent.getSource();
oSmartFilterBar.getControlByKey("YourFilterName").attachValueHelpRequest(this.onValueHelpRequest, this);
},
onValueHelpRequest: function() {
if (sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.test == null) { //second time sets test=fntest2 which causes a loop
sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.test = sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.onAfterRendering;
}
var fntest = function(oEvent){
this.test(); //call original onAfterRendering
var vId = this.getId();
if (vId.includes("YourFilterName")) {
var oId = sap.ui.getCore().byId(vId);
if (oId) {
oId._sTableTitleNoCount = "Periods";
oId._sTableTitle1 = "Periods ({0})";
}
}
}
};
sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.onAfterRendering = fntest;
},
Hello rlachemann,
I haven't tried this, but maybe this code will help. You can get the instance of the internal table. If you attach the updateFinished event, you can determine the number of items.
_oVlaueHelpDialog.getTableAsync().then(function(oTable){ oTable.setHeaderText('Period);})
Best Regards
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.