MVVM viewmodel bindings on ListView entry widgets failing during cook due to null CDO

We’re on UE 5.4 , but looking at the 5.8 dev branch on GitHub, UMVVMBlueprintViewExtension_ListViewBase::Precompile and Compile still appear to have the same issue.

Problem:

ListView entry widget viewmodel bindings silently fail in cooked builds when using MVVM bindings to bind an array to SetListItems.

Root cause:

In UMVVMBlueprintViewExtension_ListViewBase::Precompile and Compile, the code accesses EntryWidgetClass->ClassDefaultObject to get the entry widget’s blueprint view. During cooking, blueprint compilation order does not guarantee that the entry widget class has been fully compiled before the containing widget. When the CDO is null, the compiler silently skips creating the runtime UMVVMViewListViewBaseExtension, so entry widget bindings never work.

Our fix:

The CDO was only used to reach CDO->GetClass()->ClassGeneratedBy. No instance data on the CDO was ever read. We changed GetEntryWidgetBlueprintView to take a const UClass* instead of const UUserWidget* and access EntryWidgetClass->ClassGeneratedBy directly, bypassing the CDO entirely.

Before:

if (const UUserWidget* EntryUserWidget = Cast<UUserWidget>(EntryWidgetClass->ClassDefaultObject))
{
    if (const UMVVMBlueprintView* EntryBPView = GetEntryWidgetBlueprintView(EntryUserWidget))

After:

if (const UMVVMBlueprintView* EntryBPView = GetEntryWidgetBlueprintView(EntryWidgetClass.Get()))

Is this a safe and proper fix for the issue?

Our Repro scenario:

  • Top-level widget has a ListView with SetListItems bound to an array property on a VM (with field notify).
  • The entry widget also contains its own ListView bound to an array property on the VM passed to it.
  • The correct number of list entries are created, but none of the bindings on the nested entry widgets work in cooked builds. Works fine in PIE.

Hello,

Thank you for reporting this. This seems like the correct fix to me. I modified `GetEntryWidgetBlueprintView` to directly take the widget blueprint instead. I’ll make sure the fix is applied in the latest version of the engine.

Best Regards,

Zahra