cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Smart filter bar value help defaulting

Former Member
8,714

Using a smart filter bar with value help dialog - is it possible to default values of highlighted input fields?

E.g. Having 2 fields in the smart filter bar: 'Currency' (combobox) and 'Company code' if I select currency 'GBP' and then open the value help of Company Code I would like to have the field 'Currency Code' already defaulted with what was selected in the smart filter bar.

Accepted Solutions (0)

Answers (2)

Answers (2)

EliuGonzalez86
Product and Topic Expert
Product and Topic Expert

Hi,I was able to solve this by using annotations on the fiori app, first select the entity type that correspond to the help value.second select the property you want to add the default value, and then add the annotation common.FilterDefaultValue and the value you want

the result is this

also there's another blog on how to add default values but this worked for me. I hope that this could help you 🙂

best regards

sandesh25
Advisor
Advisor

Hi Eliu Gonzalez,

How can I repeat the same if I want to add multiple default values to the same Smart-filter bar.

thanks & best regards,
Sandesh

former_member340030
Contributor

Hi Radek Chudziak,

You need to default the data of the model bind to the controls in smart filter.

thanks

Viplove

Former Member
0 Likes

Can you elaborate a bit more? That value help dialog is generated automatically so I can't really get hold of it by id and the model behind it.

former_member340030
Contributor
0 Likes

Can you just share your code .. what you have done till now .. i can take from there and if possible provide you a solution

Thanks

Viplove

Former Member
0 Likes

We can use this as an example as mine is pretty much the same: Smart Filter Bar

So if I click on the value help of the 'Company Code' I would like to default the 'Currency' field in the dialog.
The pseudocode would be something like this:

var oDlg = sap.ui.getCore().byId("__dialog6");
var fBar = oDlg.getFilterBar();
//Create a JSON model, populate it with default values and set it below:
fBar.setFilterData(new JSONModel());

But the problem is that the dialog has a dynamic ID so I can't access it using the id.

Former Member
0 Likes

Any idea how to default it?

former_member289890
Participant
0 Likes

Can yo please help with some details steps and Sample Code ?