Possible to only do the retrieve when a tab is shown?

To my recollection it was possible in the old days (Mx2 and Mx3) to only load the data on a tab page when the tab page is shown. I would have expect that when I set the option on a tab to Refresh on shown that the data would be ommitted when loading the page for the first time for the tab pages that are not shown initially. Because when I switch to the tab with the refresh on it would again reload so the initial load is a waste of time. What I now see is that the data is loaded initially for all the tab pages and that it refresh it when I switch to the tab. How can I prevent the loading of data of the tabpages that are not initially shown? Regards, Ronald
3 answers

Depending on the tab content, loading of the tab page is still delayed until the tab page is visited. However, to be able to delay loading of the tab page, the tab page content is checked for the following requirements:

  • It should not be the default tab page (which is initially shown).
  • It should not contain any (conditionally) editable attribute widgets or reference selectors.
  • It should not contain any custom widget (unless it is nested inside a non-editable context).

If the tab page does not meet all of the above requirements, the tab page content is loaded immediately when loading the tab container. The reason that loading of the tab page can not be delayed if it contains an editable widget, is because the widget might want to trigger a validation error. E.g. an editable text box that is required.

Not loading a tab page in the current implementation means that the content of the tab page will not even be parsed. That means that widgets on a tab page that are not loaded yet are not even instantiated until the tab page is visited. So if the page would be saved without the user ever visiting the tab page, the required validation would be ignored. It would also cause microflow validation feedback to end up in a dialog instead of below the widget.


On a slightly related issue, with the use of responsive layouts, you often now want to replace tab containers with group boxes. So the issue here is whether collapsed group boxes could be set to not fetch their data until they are expanded. Otherwise there could be performance implications to updating the layout style (- or not if tab pages now retreive all data initially too)


This really sucks! It looks like they were not able to find a proper solution to this issue and only resolved it for the most common uses, but not for all use cases. 

I have a plot on different tabs that gets data from 2 microflows and a list of items to plot data for. Whenever I select a different item, both microflows are triggered as both tabs ‘refresh’ (also the not visible tab) making for very slow response times on the user interface.

Not great Mendix, really not great!