Unable to refresh the custom dropdown

I have custom dropdown in a data grid 2 Please refer the screen shot below. for 360 degrees --->DifferentiatedPlays -->SIAM i have a set of categories. wen i have selected an option for SIAM in the 360 degrees section...and i go to 300 degrees section the option should change based on the values of the the 300 degrees.. but this is not happening. the options of the 360 degrees are displayed in SIAM of 300 degrees section again. The custom dropdown is not refreshing based on the input values...I could see the data is correct when the drop down is not loaded already. But when it is loading for the first time it is working correctly…...   Thanks in Advance!!!!!!!
2 answers

I am getting the same problem here. I have on the same page one CustomDropdown where I can select a CLIENT. And a second CustomDropdown where I can select one of the ORDERS or INVOICES which belong already to the client.

If I select the client first and then click on one of the other CustomDropdowns then they load and show the correct options to pick. But if I then change the CLIENT again the CustomDropdowns still show the options for the old client.

I tried
- via onChange event of the CLIENT Dropdown to refresh the Dropdown for the ORDERS and INVOICE and every object above it which contains it (without refreshing the page itself)
- via onFocus event on ORDERS and INVOICES to refresh in Nanoflow and Microflow (with requesting refresh in client)
- even deleted the CustomDropdown Context object in Nanoflow and Microflow

In some cases the Dropdowns show a “loading”. But in all cases they continue to show the old list of options.

Unless I refresh the entire page.

Any new advice how this could be resolved? As otherwise this makes the CustomDropdown in some cases less useful than it could be.



After posting this problem as issue on GitHub (here: https://github.com/mendixlabs/CustomDropdown/issues/37) I got following answer from Nick Jansen (who seems to be the original or main author behind the CustomDropdown Widget):

Nice to hear you are using the widget! What you describe was indeed an issue, @NammNguyen and @BananiMendix ran into the same thing and opened a pull request that solves this issue. I just created a release and published the new version in the mendix marketplace. The new version has added a boolean named "Refresh on context change" in the options section, set it to Yes and make sure you create a new context object each time you want to refresh the default options. I hope this also solves your problem.

After updating to the new CustomDropdown widget I

  1. Enabled inside the settings (1st tab at the bottom) of the CustomDropdown widget “Refresh on context change”.
  2. Added a Microflow/Nanoflow to the first CustomDropdown which onChange of the first one deletes the context of the second one.
    To achieve that I had to extend the CustomDropdownContext and link the context to the actual record so that I can retrieve that via association.
    I tried also to change the Context in another way (for example changing a time stamp) but that did not worked for me.

I will optimize my version a little bit but in case you need some screenshots or more details to be shared just let me know.