How to Put Validation on SmartFilters?

We have a SmartFilter bar and we are displaying two fields as default filter. We would like to put some validations on these. So for example user should at least enter some values in filter before hitting Go button.

How can we achieve this?

1 answer

  • answered 2017-01-11 14:22 Sunil B N

    set mandatory property inside the controlConfiguration of SmartFilterBar

    var oSmartFilterBar = new sap.ui.comp.smartfilterbar.SmartFilterBar({
        ...
        controlConfiguration:{
            ...
            mandatory : "mandatory",
            ...
            },
        ...
    });
    

    Read more about controlConfiguration

    Working example is here.