Listview - getting started in BP

When using the treeview component, why can I only get the data of the second layer? How to set up to get the data of the third layer and the fourth layer?

I’m using a ListView widget to show a sub-menu of all the equipment the player has, so they can select which they want to equip to the player character. I want the sub-menu to be removed from the viewport after the player selects something to equip. However, so far I can only get the individual list entry to be removed - the sub-menu is only removed if I call Remove All Widgets, which isn’t ideal as that also removes the menu behind it.
(I’m also not sure how to make the semi-transparent background [Image_74 in the last screenshot] scale with how many entries there are in the list, so for now I’ve just set it to a specific size.)




Just adding to the helpful resources here… if you need to remove one item from the ListView (in my case a TileView), from the list item itself, there are helpful interfaces to call:

Note: Visually not transmitted, but this defaults to “self”. No need to hook up if calling internally.

Hello,
First of all, thank you for this resource, it is very helpful.
I am using treeview to show a directory list and I want to expand a subdirectory by selecting it. For the first subdirectory it is working as expected, but I can not expand a subdirectory of the subdirectory. Is this normal behaviour?
The Item used to create the widget contains only 2 strings, the directory name and the parent directory, and an array (same type) containing the sub directories of this directory. The array is passed to the return node of the On Get Item Children event.
Help is very much appreciated.
Thanks,
Richard

Would HIGHLY RECOMMEND this way simpler and better implementation of how to do a treeview:

You can download the files by supporting them on their Patreon for $3 and it’s WAY BETTER and simpler than the official Treeview implementation IMO

Don’t need to deal with passing Objects around, Casting a bunch of times in obtuse non-legible recursive situations, etc… It’s data oriented - you populate a data table with your data from whatever form you are getting it from e.g. JSON, Array, CSV or otherwise and you can thus easily see the table you are setting up in one place, and generate the widget from it. So much easier, honestly - I already implemented both.

I’m having trouble updating entries in a list view.

I have a ListView showing the player’s inventory. The first column displays whether or not the item is equipped.

Each entry is represented by an ItemDisplay object which contains:

The Item
IsEquipped (boolean)

When I equip an item, I set isEquipped boolean to true or false.

And then… what? How can I refresh the entry’s display?

As far as I can tell OnListItemObjectSet only happens during the entry’s creation.

I’ve tried removing and creating a new object, which unfortunately shuffles the list (where the equipped item goes to the bottom).

I’ve tried clearing and adding the entire list back, but that does not trigger any refresh.

So, how can you update the entry’s data and widget, if the data changes?

I know this is late, but if it helps anyone, the event OnListItemObjectSet runs when the widget is created. If you run RegenerateAllEntries on the listview (treeview, etc.) it will refresh all the widgets and rerun the object set event.

image

That being said I found it’s a bit easier for my use case to just manage it all via the data object itself. So make a variable in the data object of the same type as your list entry widget. Then in the OnListItemObjectSet event you can assign that variable for the object to self.

Now, when you update the data in the data object add some function or event there you can call that will then manage whatever data you need to manage in the widget. This way you don’t have to constantly recreate all the visible list widgets. Also make sure to add your update stuff in the list item object set event, since the widgets will recreate them selves when the go out of and back into view, etc. (Or implement something so you can do that manually on the backend if needed)

1 Like