on 08-02-2023 12:57 PM
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.
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
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();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
77 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.