searchDropdown empty -  list not populated  with resultList from data action
Question
Application Type
Reactive

Hi,

I have an issue with a searchDropdown that isn't refreshed when the list that it uses is filled.

The fun part is, that if I use a normal dropdown everything works as expected and the dropdown shows the possible options. Even when I have both dropdown(the normal one and the one with the search option) then also the search option is list is now showing correctly.

When I remove the widget with the dropdown then the other one isn't showing the options anymore. When debugging, the data is always there, the list is filled, but the widget stays empty.


  • The user selects/searches a country from the available options( List from aggregate)
  • the user fills in the zipcode
  • in the "onblurevent" of the zipcode widget there is clientAction called "validateZip"
  • validateZip will query the database for a regex  and check if your Zipcode matches that regex.
  • if if does, then I do a refresData of DataAction( DataAction calls serviceAction from other module that calls API)
    from the resultlist I only use the "Name"Attribute
    This works as expected.


                                                     DataAction image


both dropdowns use "dataAction.Result" as this is the  list they need. As you see in the first image, it works. Now, when I delete the upper dropdown, then the lower dropdown also doesn't work anymore.

the dataAction has 2 inputs( countrycode and zipcode, needed for the API)

Although a "dropdown with searchoption" is not strictly needed here, it is very strange, that it won't work.

Where did I go wrong on this one, or is this a bug?

Help appreciated,

Geert

 AJ,

Thanks for the help!

It finally works.  After creating the onafterfetch and doing the assign it still wasn't working, unless when debugging.

Now I found that when you fill in the zip and 

  • click on the searchdropdown =>  the widget is not populated
  •  use tab to go from the zipinput to the searchdropdown and then click on it => the widget is populated.

The api is called  in the onblur event of the zipinput,  I now used the "isdisabled property" onthe searchdropdown  to disable it as long at the list it uses is empty.



Geert

Hi Geert,

If possible, please share a screenshot showing the properties for both the Dropdown widget and the DropdownSearch widget. For e.g. as shown below:


Regards,

AJ


debugging when using "Belgium" and zipcode "9200"


Both dropdown are populated. When I remove " cityDropdown" and publish again, then "citydropdownsearch" remains empty.

The list that is appended in the DataAction is list of   text Record. 


When a user register I want to store the name of the city, so I don't  actually need the the "value" to be different from the label.

Geert

Hello Geert,

Please verify whether you are assigning the dropdownlist items in the 'On After Fetch' event action as shown below. Without this approach, your dropdownsearch widget likely renders before the data has been fetched and that could be your problem.

Regards,

AJ

 AJ,

Thanks for the help!

It finally works.  After creating the onafterfetch and doing the assign it still wasn't working, unless when debugging.

Now I found that when you fill in the zip and 

  • click on the searchdropdown =>  the widget is not populated
  •  use tab to go from the zipinput to the searchdropdown and then click on it => the widget is populated.

The api is called  in the onblur event of the zipinput,  I now used the "isdisabled property" onthe searchdropdown  to disable it as long at the list it uses is empty.



Geert

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