ListView vs ScrolBox?

Hey everyone, can anyone explain the difference between both of these for me? I couldn’t pick up anything from the documentation and I also don’t know what virtualization is in UMG.
Thanks!

Imagine you have 200 widgets.

If you place widgets in a Scroll Box, all of them get instantiated, their assets loaded and it all sits in the memory. If you use a List View, only the necessary widgets will be created - on the fly. The List View will automagically maintain their lifecycle.

There’s a tangible example at the end of this post:

A combat log like this could easily grow to hold thousands of widget entries, but the likelihood of the user wanting to seem them all is pretty low. So it’s better to have a List View hold just the data, rather than have a Scroll Box keep it all alive at all times.


This tooltip:

image

is not really that accurate in my experience, more than 5 would be created and kept alive. I’d say around 10, but that’s much better than 200!


If you need to display just a handful of widgets, a Scroll Box will be more than fine. If you need to handle hundreds or thousands elements, consider paying the upfront cost of setting up a List View.

3 Likes

To add on to this, you do need to be careful with listboxes however, as they are quite complicated and can lead to complex and bugged implementations.

They also do not play nice with controller support - It can be done, but it’s a ballache

2 Likes

Hello All ! Hello Everyone ! I just discovered this topic and I have small question.

As the listview only generate widget at runtime. How will you handle a Search box to retrieve, filter elements into the list ? I have 5000 lines. Cannot figure out, so I still use Scrollbox.

All the best !
Spheryflex

Is there a limit number of widgets that’s recommended for the scroll box?

There is not. Besides that, some widgets are more complex than others. Also depends on what you do with the scrollbox and its widgets.

If you keep destroying a scrollbox with 1000 children, you will need to reconstruct all of them next time it needs to show, and then keep all 1000 in memory for the duration.

This is not an issue with PanelViews.

1 Like