How to reload data in a Combo Box when it is clicked

0
In Mendix 10.24, I am using a Microflow as the data source to populate a ComboBox. When the page first loads and I click the ComboBox, the system triggers the Microflow correctly. However, on the second and subsequent clicks, the system does not call the Microflow again. I want the system to execute the Microflow every time the ComboBox is clicked to ensure the latest data is loaded.please check the image is attached in the attachment!
asked
3 answers
1

What you are seeing is expected behavior.


A microflow data source is executed when the widget is loaded or when its context is refreshed. It is not designed to run again every time the user simply opens the dropdown. Mendix also uses client-side caching for loaded objects, so reopening the Combo Box usually does not trigger a new server call by itself.


So the direct answer is: no, a normal click on the Combo Box will not automatically re-run the microflow every time. If you need fresh data each time, you need to explicitly refresh the context that drives the widget. When an object is refreshed in the client, relevant data sources are reloaded.


Best-practice options:


  1. Use a helper object / NPE in a Data View and let the Combo Box read from that context.
  2. Before the user opens the Combo Box, trigger an action that refreshes that helper object in client.
  3. After that refresh, the data source can be loaded again with the latest data.



If you are using the Marketplace Combo Box widget, it does have events such as On enter action and options like Lazy loading, but those are still not the same as “run the data source microflow on every click.” They can help you trigger your own refresh logic before the user selects a value.


So in practice, the clean solution is:


  • do not rely on the open/click itself
  • add a small refresh action around the Combo Box context
  • or use a separate button / event to reload the source before selection


If this resolves your issue, you can mark it as accepted.


answered
1

Hi,


This is expected behavior when using a microflow as the data source for a Combo Box in Mendix.

Why it happens

When a Combo Box is configured with a microflow data source, Mendix executes that microflow only when the widget is initialized (i.e., during page load). After that, the results are cached on the client side, and clicking the Combo Box again does not re-trigger the microflow.

So by design:

  • First click → data is already loaded (microflow executed on load)
  • Subsequent clicks → no re-execution, because data is already available

How to reload data on every click

There is no direct “on click reload” option for a Combo Box, but you can achieve this using one of the following approaches:

Option 1: Use a refresh trigger

  1. Do not rely solely on the Combo Box microflow
  2. Instead:
    • Create a helper object (non-persistent or persistent)
    • Add a microflow that retrieves the latest data
    • Store the result in an association/list
  3. Bind the Combo Box to that association instead of directly calling a microflow

Then:

  • Add a button or event (e.g., on change / before opening alternative)
  • Call the microflow
  • Use Refresh in Client = Yes

This ensures the Combo Box always reflects updated data.

Option 2: Force refresh using a wrapper + microflow

Since Combo Box does not have an “on open” event, you can:

  • Place the Combo Box inside a Data View
  • Add a button or clickable element near it (or overlay UX)
  • On click:
    • Call a microflow
    • Refresh the parent object (Refresh in Client = Yes)

This forces Mendix to reload the data source.

Option 3: Use a custom widget

If you strictly need reload on every dropdown open, the standard Combo Box will not support this.

In that case:

  • Build or use a custom React widget
  • Trigger data fetch inside onFocus / onClick

This gives full control over when the data is loaded.


Mendix is designed to avoid unnecessary server calls, so it caches data intentionally. Continuously calling a microflow on every click can impact performance.

Recommended approach:

  • Load data when needed (via explicit refresh)
  • Avoid forcing reload on every click unless it is truly required


  • Microflow data source executes only once (on initialization)
  • Subsequent clicks do not re-trigger it by design
  • To reload data:
    • Use refresh patterns with associations (recommended)
    • Or force refresh via microflow + client refresh
    • Or use a custom widget for full control



answered
0

Thank you ,

answered