How do I communicate between a list view entry blueprint and the overall UI blueprint?

I followed this tutorial on creating dynamically generated list views for my in-editor user interface. I wanted to have a system for communicating to the main user interface when a button had been clicked from within one of these list view entries. I followed this tutorial on blueprint interfaces, however at 3:35 in the video I’m stuck as I don’t have a reference to my main UI when calling this event.

Here is an example of me generating a list of elements in my main UI with their image and text fields populated.

image

Here is a screenshot of my main UI’s blueprint interface for where the event calls to:

Here is a screenshot from within my list entry to which we call the event:

Here is a screenshot of my console after pushing several list entry buttons:

image

Here is my desired result to which clicking the button labeled “Red” would populate my editable text field with the same text:

image

If blueprint interfaces isn’t the solution, then perhaps someone knows of another way of communicating between UI widgets? Is there a way to use global variables?

Thank you to those whom it may concern.

Don’t use the node “TriggerEventSetTheme” from “WTextureThemeEntry”.

After making the interface you should have a node like this available

image

This node accepts any object as Target. The function will be triggered if that object implements the interface, otherwise the call will be ignored. Use “GetParent” to talk to the parent widget.

image

3 Likes

(post deleted by author)

I followed your advice, then directly placed my list entry widget into my main UI’s heirarchy and achieved the results I desired. :slight_smile:

image

My original problem still stands in that I’m using a list of dynamically generated list entry widgets. These widgets don’t consider my main UI to be their parent. For my purposes, I’ll consider this solution complete and statically declare my list entry widgets.

Have you tried printing the result of GetParent() ?

The parent is most likely the widget upper in the hierarchy, so if you add them for example to a Horizontal Box within the main UI, then the parent might be the horizontal box.

You might want to declare your own parent-equivalent variable in the child widget, eg. an UserWidget variable named “ParentUI”. Enable “expose on spawn” for that variable. Then, when you are create them from the main UI, you can assign “Self” to the “ParentUI” variable directly in the Create Widget node. Then use that variable for triggering the event instead of GetParent.

1 Like

Printing the parent would only output “None” to the log.

Your solution for creating a User Widget variable that’s exposed on spawn and instanced editable worked! :partying_face: It allowed me to pass the MainUI as self to each instantiation of the widget. Thanks for such a great learning experience.

For anyone else following along with the linked videos, you’ll want to create this variable in the list entry blueprint, list data entry blueprint, and data struct, being sure to pass this variable along just as you are asked to do with the “text” and “more text” fields.

Here is an example of my data entry blueprint.