76
Views
6
Comments
Combo box on change for another combo box
Question

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.

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello Maha.

The logic looks ok.

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

2024-06-19 07-19-32
JitendraYadav

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

UserImage.jpg
Maha Alqarni

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

2024-06-19 07-19-32
JitendraYadav

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.

2021-09-10 14-03-53
Salman Ansari

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


2026-01-19 17-09-56
Carlos Lessa
 
MVP

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.