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:
- Data populated in my UUserWidget subclass is erased when the widget is constructed at the point it is added to viewport.
- 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!