UMG ListView entry "Event On List Item Object Set" doesn't be called after ListView adding item

To use ListView, you should use AddItem to add a new item for entry.

In entry class, you implement Event On List Item Object Set to get item object, then you can use the item object data for your custom logic.

But I find my Event On List Item Object Set doesn’t be called after ListView adding item.

Following blueprint shows how I validate the calling of Event On List Item Object Set.

In top level ui I control the ListView. When the ui is constructed, call AddItem of ListView.

In ListView entry class, add a print to see whether event is called.

Run the game and there is not Hello printed.

The above looks fine. How is the List View owner widget instantiated / added to viewport?

It is created by CreateWidget in level blueprint.

The top level widget

The entry

The level blueprint

After running it in empty level (Even though the level is empty, but my project has global game mode, so it will create many stuff when begin game. However it should doesn’t matter.)

We can see “Testing” text, it means the widget is attached.

And the new item is shown.

But the Event On List Item Object Set doesn’t be called.

This is a problem I personally caused. The reason is that I used a derived class developed within our company, but I didn’t know how to use this derived class correctly. Now I use the native widget class plus the User Object List Entry Interface.
Sorry for wasting your time.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.