Combo box on change for another combo box

Hello..

I used 2 combo box the first for get the cities from API REST then by the city id will get the district from API REST for the second combo box

the issue is when i select the city , the combo box of districts is not filled!

i did this steps:

- Set the source of combo box2 to local list

-on onchange of combo box1 call the Api to fetch data for combo box2

- assign response to the local list that is set as source to combo box2


  Any help is much appreciated!


Thanks.

Hello Maha.

The logic looks ok.

If you are doing it in traditional, you need to ajax refresh the second dropdown.

Yes, I am agreed. only need to use the Ajax refresh of the widget.

Nuno Reis & Jitendra Yadav thank you for your reply, I added the Ajax but still not worked,
I do not now what the problem!!

Maha Saad wrote:

Nuno Reis & Jitendra Yadav thank you for your reply, I added the Ajax but still not worked,
I do not now what the problem!!


Hi,


Can you please share the snap.


Thanks.

Maha Saad wrote:

Hello..

I used 2 combo box the first for get the cities from API REST then by the city id will get the district from API REST for the second combo box

the issue is when i select the city , the combo box of districts is not filled!

i did this steps:

- Set the source of combo box2 to local list

-on onchange of combo box1 call the Api to fetch data for combo box2

- assign response to the local list that is set as source to combo box2


  Any help is much appreciated!


Thanks.

Hi Maha, add an ajax refresh after the DistrictList assign, the element you should do the ajax is the District.id.

Best Regards

Carlos Lessa

Maha Saad wrote:

Nuno Reis & Jitendra Yadav thank you for your reply, I added the Ajax but still not worked,
I do not now what the problem!!

Hi

You need to refresh your combobox using Refresh widget.

If possible could you please share oml