Data set in UUserWidget is reset when it is added to viewport

I’m hoping to display RPG quest log data organized in a table via a ScrollBox wrapping a Uniform Grid Panel with three column List Views, one List View for each log category and each List View item being an actual log data UUserWidget subclass to make this:

My problem is that I need to populate data on the log widget, but it seems that the widget’s constructor doesn’t run when I call CreateWidget(); rather, the constructor runs when the containing List View is added to the viewport. At this point, the data I added after calling CreateWidget() for each quest log widget is erased.

Even if I wait until after the log widgets have all been constructed and iterate over them via List View’s GetListItems() to set their data, the displayed list item doesn’t change (although if I query it, the backing data has actually changed). For simplicity, I’m starting with setting the Title Text subwidget of the following BP widget:

So there’s essentially two problems, only one of which needs to be solved:

  1. Data populated in my UUserWidget subclass is erased when the widget is constructed at the point it is added to viewport.
  2. Data updates sent to the widget directly via Title->SetText() after construction are not rendered, even though subsequently calliing Title->GetText() does show the updated value. If I use a function binding Get_Title_Text() to set the Title text instead, a similar problem occurs where the updated backing data doesn’t match what’s displayed (the displayed value is the stale initial value) and it doesn’t match what is reported in Get_Title_Text() (also the stale initial value). The updated value is returned as expected when I query the backing data directly, however.
    LibraryBook Get_Title_Text():

The Library Reshelve() function I call after everything is added to viewport in an attempt to set values after construction (nevermind the debug wires mess):

Any idea what’s going on and how I can populate these widgets with data before or after construction such that it gets reflected in the display? If more context is needed, the entire project is available at GitHub - mysterymagination/ryddelmyst: cutethulhu meets Castlevania on the battlefields of Final Fantasy Tactics!

I haven’t found a good solution to this, but I came up with a silly workaround that seems good enough: since these user widgets in a list view resist all my efforts to set data top-down, I decided to try a bottom-up paradigm where the widgets pull the data they need when they’re constructed. To facilitate that I created data pools for each set of categorical quest log data that empties as widgets pull from it, meaning each widget gets unique data until there is none left to pull. The trouble with that is that each leaf-node widget doesn’t know anything about which data pool it should pull from – for that I thought about trying to look up the widget tree and figure out which list view a given widget was in, but a glance at the whole parent->outer->outer… dance that apparently requires (Get parent UserWidget of Widget - #5 by Firefly74) made me physically ill so instead I just abused inheritance by creating specific widget subclasses that are set as the expected data entry class for each list view and can therefore assume the data pool that relates to them.

Hello there,

I think you misunderstand how List View is used.

You don’t set widgets directly - you add ListItems to the List View and let the List View handle its internal widgets (which fill their own data when the List View supplies it to them) The whole idea is that you can have thousands of data only List Items but only a few widgets - the ones you currently see. When a widget is scrolled out it is reused and filled with the next item’s data.

It’s a bit complicated and I can’t explain it in short but luckily there is a great post about it: