cancel
Showing results for 
Search instead for 
Did you mean: 

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

teejay
Participant

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member340030
Contributor

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

junwu
Active Contributor
0 Kudos

usually we only are supposed to call public method

junwu
Active Contributor
0 Kudos

why you need that event to be fired?

teejay
Participant
0 Kudos

Its a long story 🙂 but simply I had to record as province got changed and take some action.

junwu
Active Contributor
0 Kudos

you changed the country, you know the province is changed. why bother to fire an event?