Skip to Content

How to fire sap.m.select Change event when default value is set automatically via another control?

Hi,

I have implemented sap.m.select for Country and Province dropdowns.

On change Country event I am setting the filter on Province (to only show province realted to selected Country). When I debug Change country event , the new province value is still not available inside function after following filter is applied on Provice.

bindingProvince.filter([new sap.ui.model.Filter("CountryID", sap.ui.model.FilterOperator.EQ, selectedCountry)]);

The new Province is correctly selected on UI.

My requirement is to also trigger Province change event to capture that Provice has also been changed altough user didn't actually change the value explicity. I did not use combo box control as my requirement is to also default the first entry.

Is there any way to fireChange Province event with new value whenever Country change is triggered ?

Thanks,

TJ

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 24, 2017 at 05:40 AM
    -1

    Problem solved, Its working after I put a delayed call for "change Province" after Country Filter is set.

    Thanks for your inputs.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 23, 2017 at 09:37 AM

    Hi Tarun ,

    Did you try fire change event (https://sapui5.hana.ondemand.com/1.26.6/docs/api/symbols/sap.m.Select.html#fireChange)

    thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 21, 2017 at 12:46 AM

    why you need that event to be fired?

    Add comment
    10|10000 characters needed characters exceeded