Listview - getting started in BP

Variables can be checked as “instance editable” and “expose on spawn”, so when those classes are created, the variables are available.
Not sure what you mean about “set strings to generate”. There’s an append node I use a lot, so if I wanted to build a string that said what kind of animal something was, it would look like:

"Animal type: " -> into append (or directly on the node itself)
(get animal type)->to string -> into append
resulting in a string that says “Animal type: Dog”.

It looks like it’s the cast that fails.
You create an object called “Recipe List” and add it to the listview. Then “On list Item Object Set” you cast the Item to “Test Object Recipe”.

Just print-string debugged, you’re right, the cast does fail each time.
I am still trying to wrap my head around how to pass data between the objects.

So the entrywidget is the unit for the listview.
The listview is the UI that shows all the entrywidgets as per whatever list you have.
But if my entrywidget is the object I want to show in the listview and modify a sub-object (like a textbox or even a texture), how do I access that.

The cast failed and I see why, the object itself makes no sense.
I thought I was creating the entrywidget and then accessed a test-object that contained the variables but that isn’t true.
I am still thinking this through…

Perhaps what I am doing wrong is I am not editing the text properly.
In the recipelist (entrywidget), I set up text variables, instance editable and exposed on spawn, set up in the designer as a variable and the content text is bound to that variable.
In the Listview, when I create the object, I modify that variable based on a datatable.
Then it is added.

The setup you had in the entrywidget was correct - if you casted to the correct object type. You need to either cast the item to Recipe List, or add Test Recipe objects to the list which makes more sense.
In my example I add some actors to the listview. The Item object needs to be cast to actor to access actor properties. If I make some “ball actors”, I need to cast to “ball actors” to access that class properties.

Since I saw your node setup I thought that adding a Recipe List to the list view didn’t *sound *correct - the Recipe List would be the object that holds all the recipes, like a cook book. Where as each recipe (in this case the Test Recipe object) would be each recipe in the book and should be what is added. Thematically speaking.

Then again maybe you have several Recipe Lists, since there are 2 entry widgets created. Is that the case here?

Almost?
I have a struct called recipe, it contains the name, ingredients, quantities, a texture and a time as a float.
Then I created a **datatable **with that struct and so far I only have 2 recipes.
My save file then has a recipe array; if it’s in there, it exists, if not, it does not exist.

In my original UMG setup, since I don’t use ball actors or any actor for that matter, I made it access the save file and from the save file, access the datatable to retrieve the information needed.
The Listview is set up to populate for each recipe you own. So far in my test, you own 2 recipes and if I modify that value, it shows the correct number of items.

The final setup is the recipe widget object that is gathered to populate the listview. That widget contains 5 textboxes set as variables and enable.
This is where it stops making sense. When the listview loads each item or recipe, it stores that value from the datatable somewhere but it does not change the actual value of the textbox.
Originally, I used a random actor to contain that info and cast into it the new data and to retrieve that data to be put in the recipe UI object. However it never did.

I think I am past the listview building part and more into the UI objects themselves. I am at a loss frankly as to how to edit the text boxes inside.
Again, when printing string from the object newly added and created, it will return those values. However, the textboxes do not change their content…

I really appreciate you sticking around and supporting me thus far. In your tutorial you use actors and I am still using widgets and I am not sure how to get around that.

@ste1nar Well i figured out a way to make it work!
The text values were reset under a function and cast to instead of using a variable.

Thanks for this amazing Tutorial, i’m actually following up this tutorial step by step, and i have a question, how did you managed to make an input to the “Create widget” node, when you specified the “Example Text” and you put the “Create widget” there was an input to “Example Text” as a string, when i did mine there was no inputs for my widget, how to make it like what you did here
https://forums.unrealengine.com/filedata/fetch?id=1595440

To expose any variable to the spawn or any create node, check “Instance editable” and “Expose on spawn”
ExposeVarOnSpawn.png

actually i’ve managed to make it work (and pass the ItemName to the listview by casting), but still no input node when placing the “Create Widget” or “Construct Widget”. even after exposing on spawn and mark as editable.

Right click the node and Select “Refresh Nodes”

omg how did i forget about that, i guess all i did was compile and save, multiple times, totally forgot to refresh node. :smiley:
Can’t believe i’ve did that, Thanks a lot and the tutorial is amazing, i’m following step by step.

Can this tool serves as a search result output for objects from an object library to display objects from the content browser, not only actors spawned in the scene?
and when selecting objects from list it loads those objects and spawn them into the level Asynchronously?

Yes, the listview can be used in utility widgets. And can be used to display any data. You may have to create an object just to hold the class and add the object to the listview.

Here’s an example of something a person has made using the listview.
https://forums.unrealengine.com/development-discussion/python-scripting/1605163-the-making-of-unused-assets-viewer-editor-tool-in-bp

Tha’s Amazing, i’ll try to make it and share my result right after i get it all working, Thank you so much.

Another Question Please, does the list view only works with objects? for example i want to make a UMG fill some text entries data into a list, not particularly for objects. Just talking simple list of strings, but each one is a separate entry… is that possible? and how to do it?

I though about it now, i can just make a vertical box with buttons that are driven from the main UMG, and when clicked it passes the data in each button and make a certain action.
but i wonder if the list view only needs an object or actor to work.

The listview needs an Object reference to be added as an item. And since Actors inherit from Object, they are objects too.

@ste1nar Quick question: is there a way for the listview object to see the listview it is currently in?
I have my list item contain a button to use or drop it. I would want it to be removed from the listview but alas it is not. I tried remove from parent.

I am contemplating casting to my character to modify a temp var and back into the listview afterwards but holy cow that is complicated… any ideas?

To get the listview an entry widget belongs to, there’s a function in the entry widget called “get owning listview” I think.

But I don’t think that would be a proper way to handle your case.

If you want to remove an item from the listview, then remove that item from the listview. That logic should go in the listview (or rather, the widget that holds the listview)
The entry widget holds the button that drops the item. In order to inform the listview that that action happened, the most practical method is to use an event dispatcher in the entry widget, which provides the item it represents, and in the listview bind to it during the generated / initialized event.

I’m trying to use the Tile view to show a Photo Album. I want to set the Keyboard focus on the first widget entry when i show the page so i can navigate using the gamepad, but i don’t know how to get the widget entry giving an index or maybe his Item. what can i do?

I don’t know anything about navigation, focus or gamepad usability.

When the tileview is created or displayed, you can set focus to the tileview, which allows for keyboard arrows navigation. I don’t own a gamepad.
However, hiding and displaying it will have the focus where it was, not at the first item.

If focus is not important, you can highlight the current item using the Set Selected Index and On Item Selected events.
To navigate, Get Selected Item + Get Index for Item and increment or decrement to go horizontally and add /remove the column number to go vertically, followed by Set Selected Index and Scroll Index Into View

I tried to add some functionality so that navigation would jump from first index to last and vice versa, but doing that caused some entries to be displayed as if they are selected.

  • The reason this is happening is because the entry that was selected does not receive a “on selection changed (false)” call. Another example as to why resetting the entry on its release is useful.

Can’t really help with non-mouse umg navigation.