Skip to Content
0

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

Jan 20, 2017 at 06:43 PM

885

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Tarun Jain 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.

Share
10 |10000 characters needed characters left characters exceeded
VIPLOVE KHUSHALANI Jan 23, 2017 at 09:37 AM
1

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

usually we only are supposed to call public method

0
Jun Wu Jan 21, 2017 at 12:46 AM
0

why you need that event to be fired?

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0