cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 ValueHelp Include Range Operations

rlachemann
Explorer
0 Kudos

I'm using SAPUI5 Fiori List Reports based on List Report Templates and CDS.

I managed to set the Filter ValueHelp Include Range Operations via attachValueHelpRequest and it seems to be working.

Update: If you open the ValueHelpDialog a second time it generated a loop. This has been fixed by only setting the prototype.test function if it's null or undefined.

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.setIncludeRangeOperations(["EQ"],"numeric");
		   }
	      }
	  }
    };
    sap.ui.comp.valuehelpdialog.ValueHelpDialog.prototype.onAfterRendering = fntest; 
},






Unfortunately you can still manually enter different Filter Operations (e.g >=0).

Is there a simple way to prevent this?

WilliamW
Explorer

Have you considered trying to use local annotations to achieve this?

SAP Help Portal

Accepted Solutions (0)

Answers (0)