on 09-02-2021 6:14 PM
Hi,
I have a requirement where I need to change/modify the list of filter operators in the value help dialog of a selection field in the smart filter. Also, I don't want the "Exclude" option in the value help dialog.
Currently, I tried to remove the Filter operations in the initialise event of smart filter. I have to use the same code by which we can change the default operation of the field in the smart filter. But, even if I remove the filter operations in the token parser, it is kept on coming in the value help dialog.
Please find the code:
Please suggest any solution to achieve this requirement.
Hi @devanshpandey
looking at the screenshot I presume you use version prior 1.84, where we have two separate sections for include and exclude. This has changed since 1.84 as we have the two sections placed in one dropdown list. I think with the old design it's not really possible to completely remove Include/Exclude section.
But anyhow you can change the operators if you explicitly set them via those two methods (latest UI5 version docs)
https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.comp.valuehelpdialog.ValueHelpDialog%23methods/set...
So for string field if you want to set the exclude operators only to Contains, Starts and Ends you can do sotmething like this.
this._oValueHelpDialog.setExcludeRangeOperations([
ValueHelpRangeOperation.Contains,
ValueHelpRangeOperation.StartsWith,
ValueHelpRangeOperation.EndsWith,
], "string");
btw, similar question asked here
cheers,
Vladimir
SAPUI5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok you could try this, If you want to remove the Exclude section. When initalizing the value help set maxExcludeRanges to 0
onValueHelpRequested: function() {
this._oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({
title: "Product",
...
maxExcludeRanges:0
});
and then supply empty list of operators
this._oValueHelpDialog.setExcludeRangeOperations([
], "string");
Hi vladimir.velinov ,
Is there a possibility to change the Operations List via an odata annotation? In our case we have a SmartFilterBar and an annotated odata service. The value help dialog is generated by the given odata annotation information.
Is there another way to intercept the generation process?
Kind regards,
Michael
Hi @michael.zwick1,
unfortunately there is no such annotation that changes the operations list. In general they are adapted to the used data type, for instance for number you don't need 'Starts with' and in some rare cases need to be modified with the API that I cited already.
cheers,
Vladimir
SAPUI5
I dug deeper here and discussed that with a team member. Turns out that we don't have legal way that you can call the APIs. Means that first you need to find the Value help dialog instance to call the API. Unfortunately we don't keep this instance after the dialog is closed. Means when you press the value help button we create the dialog and then when you close it we destroy it. To be able to change the operators list one has to hook to open event that is internal for the Smart filter bar. That unfortunately we don't support i.e. everything that is not annotated as public is considered private.
So at present, one can not change the operators list in the context of the Smart filter bar.
cheers,
Vladimir
SAPUI5
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.