cancel
Showing results for 
Search instead for 
Did you mean: 

update possible values of a Filter object with selection of another Filter object in the same page

yavuzasik
Participant
0 Kudos

Hi,

I have a requirement to update the possible values in a "Control.Type.FormCell.Filter" object. Those values should be restricted based on the selection of another Filter object. These filter objects are referring to Countries and the customers in the selected country. I could implement the same requirement with one Filter object and one ListPicker object. It was straightforward rule file implementation with the "setTargetSpecifier" method, which was explained in the following part of the document.

https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started...

However this implementation did not work out for the second Filter object. I could not either implement it with the custom rule file of the "FilterProperty" of the second Filter object. Because the custom rule file is only triggered in the beginning of the entire page.

Could anyone propose a workaround?

Thanks

Regards

Yavuz

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

I did a quick test using two filter controls. My second filter control uses a rule to return the filter values based on the value of the first filter control. For the first filter control I have an OnValueChange rule that resets the second filter control causing it to re-execute the rule to provide the updated values for the second filter.

export default function FilterOnChange(context) {
    let priceRange = context.getPageProxy().getControl('FormCellContainer0').getControl('PriceRangeFilter');
    priceRange.reset();
}
yavuzasik
Participant
0 Kudos

Hi Bill,

Thanks for the recommendation. Indeed, it triggered another call to the rule file of the second filter. This way I could collect the first Filter value and make an OData call and updated the values for the second filter.

I wonder one point though it does not cause a major issue. The rule file is called two times with the reset of the Filter object. In fact it is even called 2 times without the reset. What could be the potential cause for this? Do you have an idea?

Thanks

Regards

Yavuz

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am opening an internal issue to look into the rule being called multiple times.

Answers (0)