# Communication between widgets using data driven content

**URL:** <https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157>\
**Category:** UI\
**Tags:** unreal-engine, question\
**Created:** [December 12, 2024, 9:28am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157 "2024-12-12T09:28:09Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 12, 2024, 9:28am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/1 "2024-12-12T09:28:09Z")

</div>

Hello everyone! Iv’e been scratching my head the whole night with this issue and can’t find what i’m doing wrong.  
The case is this: I have a menu that gets populated by a data table, containing information about each button for the submenus populated first, same class, fast to pure cast with a safety branch just in case (1), then i populate a widget switcher with a custom frame with a title, a button , a scrollbox, and a text in the bottom (2), and the submenu class from the data table populates the scrollbox(3).

 ![Hierarchy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/d/f3d7924ef8ca1936afd5d79539250e22fdcad7f8.png)

So far everything works correctly about the switching functionality, but i need to show a hint every time i hover an option, and there is the issue. The hint is in the bottom of the frame that contains the current submenu, and i need to communicate the hovered/unhovered from the child (the submenu content) to the parent(the frame), but since they are created on construction, there’s no way to set a reference for an interface or a dispatcher without casting for each one, breaking the point of data driven population.

 ![Populating the buttons](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/b/5/4b5ed240b13d18f71466c45cd5d65c5fe81d932b.png)

 ![Pupulating the switcher with each submenu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/7/427dd21fac8d7c527030c96c2cbdc2c4b5cf2e4e.png)

So far, iv’e tried interfaces and dispatchers, but they need a reference from the submenu (3) to it’s container (2) and i can’t find a way of pointing a reference to an instance on construction unless i cast to each to each one to it’s class, or sending information once in game because interfaces and dispatchers needs a target, which is null (the variable for the parent is there in each submenu, it’s just nullptr)

Any help or idea will be deeply welcome and appreciated.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 12, 2024, 10:38am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/2 "2024-12-12T10:38:43Z")

</div>

> [@hdslayer1990](#):
>
> i populate a widget switcher

Dynamic binding is where dispatchers shine the brightest. Bind when you add a widget to the switcher. No casting required. Here’s what I understood:

- you have a switcher
- you dynamically add user widgets to the switcher
- you want those user widget children to communicate back to the widget that owns the switcher (you can also make it communicate with something else, ofc)

Do clarify if I got it wrong. There is no need to expose `Root` as you do, this is the precise use case scenario where dispatchers provide the cleanest comms.

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 12, 2024, 11:41am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/3 "2024-12-12T11:41:06Z")

</div>

Something like that. Everything works fine between 1 and 2 (top menu, switcher index and border) because they are created directly from the data table and are the same class, so i just point directly their respective parents with a pure cast if needed. The individual submenus (layer 3, inside the border) also work, i.e. i can already adjust all the values in game and load and set settings, and for the moment are hand taylored for each submenu because i still have to work on individual type of subwidget (slider type, dropdown, subtitle/reset/save section), but i can’t find a way to get layer 2 and 3 to communicate.  
i.e. Because i only have one class beign added for a while in the loop, i can cast to get a specific item inside, and get out of the loop to continue adding other classes if needed.

 ![How to reference the border widget instance to each different class it contains?](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/3/d134308e10244a00ba6b765e497e9b408d69b217.png)

and i’m already using dispatchers for everything))))

 ![From and to the switcher.](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/3/5f36504aa040262bb2dcf6e40686cb45bd80adda.png)

and this is already inside the border widget,

 ![Dispatchers in Border Widget](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/6/3566597171b1541c766b593dc9858f2a40151418.png)

 ![Null (Empty) because i can't reference the border instance on construction of submenu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/8/3e8a3f4d295c38f4e7dd1b5af7af03ed7dc9e258.png)

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 12, 2024, 11:58am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/4 "2024-12-12T11:58:39Z")

</div>

If i get this to work, i can continue adding the submenus items dynamically because i’ll know how to handle different classes so i can just work with the data tables to populate as needed. In this example i’m working with the Settings submenu, but many others needs to be built based on data tables, like, level variations that will populate tables as they are created and this tables will generate the individual cards in it’s respective submenu, and they will communicate the variation manager the user’s selection.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 12, 2024, 12:27pm UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/5 "2024-12-12T12:27:46Z")

</div>

> [@hdslayer1990](#):
>
> i can’t find a way to get layer 2 and 3 to communicate.

- layer 3 calls the dispatcher:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/5/e35f8fd90bbedb61fced825a76eb687a66659254.png)

- layer 2 will receive the call:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/1/5712227d3377dc3c21debc0f86c67606d9d95d8c.png)

- to bind it dynamically:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/d/f/adfe66954a846dd3907b2c0e4c92d51165c66197.png)

Now layer 3 can talk to layer 2 and they do not even know about one another’s existence.

* * *

_Assuming_ you want the scrollbox children to talk to the switcher:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/0/d80ddd0578f3f7ceec591aa03760d100980e6b7a.jpeg)

- you can make anything talk to everything else in the entire game **providnig** you can procure a reference
- you need to bind it only once
- you can bind to any number of events
- there is virtually no additional cost of calling
- you no longer need to look up reference, or worse - store an array of them
- you can unbind it
- you can destroy any of the layers and you will still not get any errors, dispatchers fail gracefully

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 12, 2024, 3:00pm UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/6 "2024-12-12T15:00:19Z")

</div>

So, before, i was populating the scrollbox directly from the main menu. I was using my main HUD to create the entire UI in one loop. Spent some amount of time trying without results, and changed my approach. Now I’m populating each border with it’s counterpart in the table, but still, doesn’t let me assign the bind to the widget i just created. Everything else is working normally, except i can’t make the hints work yet.

 ![Captura de pantalla 2024-12-12 174806](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/3/f738cfd0364eddf1fa14c7ae0ade8c6f41b82808.png)

no matter how i do it or from what pin i drag

![Captura de pantalla 2024-12-12 175957](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/3/193469ef27627aed4ce48305cf17df969d86b1f4.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 12, 2024, 3:06pm UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/7 "2024-12-12T15:06:03Z")

</div>

In order to do this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/d/bcd2f1142dc867a52d7caf8a42d23b39d22ec374.png)

You’d need inheritance where the base widget class has the dispatcher. Assuming all those widgets are of **different** classes (are they?), you can re-parent them. If you hook it up with the base class:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/7/0d78639763105fb1c6ca3c96af4135231184aea8.png)

You’ll get returned the correct type. Just refresh the node, types don’t always propagate.

* * *

Also, there is no need to plug in `Self` here.

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 13, 2024, 10:11am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/9 "2024-12-13T10:11:57Z")

</div>

Yes, they all are of different classes, and I reparented them to the border widget containing the dispatcher, used a brand new create widget node, and still get the User Widget output. As i said before, i was creating the submenus in the main menu in a single loop to avoid looping twice and getting the current index to populate the submenu inside the border. Now i moved the submenus population to the border itself and getting the index of the table by using the engine naming convention `_C_?` and getting the rightmost character, keeping out the last index because it’s the exit confirmation and there’s no need for a border like in the submenus. So the loop in the main HUD creates the buttons and a border inside the switcher, and when the border gets created, adds itself the content it needs from it’s index on the table and not beign forced by the Main menu using the loop index.

Had an Editor crash at loading the project late last night after not sleeping for almost 40 hours, so I went to bed and in the morning I had to move my UI folder outside, open the project, copy the folder back, disconnect all construction nodes on the conflictive blueprints and start to depurate one by one. Meanwhile I moved to another UI functionality (auto update input device type icons) to clear my head and try to find a solution for the menu dispatchers.

Here’s where i’m at with the menu:  
I compare the title of the current frame (second level) to the text from the table, to populate the correct submenu.

 ![Captura de pantalla 2024-12-13 125601](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/f/edf880edeb02efd196619c7675a2ed66331519ca.png)  
I’m debugging step by step. Right after the branch, i get equality  
 ![Captura de pantalla 2024-12-13 125449](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/0/b40b570e5f5eaa448dc7e0b56517f109603cfd96.png)

Right after creating the child still get them equals

 ![Captura de pantalla 2024-12-13 130027](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/2/0e2721e86529ab3c2a55f1a6a334d9f4dfdc2a87.png)  
 ![Captura de pantalla 2024-12-13 130252](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/c/3ec0be64d3f8a2ee156c0b769c9012f0d30db9a0.png)

But as soon as i add the widget everything breaks.

 ![Captura de pantalla 2024-12-13 130549](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/6/396367d26348860b854a92c9ae8289dd44dc3354.png)  
and i’m getting double items beign added.  
 ![Captura de pantalla 2024-12-13 130517](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/d/a1d18475ca4e6a566f4dd6b29e6b1d79b85694d7.png)  
In Game they seems normal, i can switch submenus and they behave as exepected, and don’t look doubled.  
 ![Captura de pantalla 2024-12-13 130907](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/7/6b75339ee658f9bc175258d3f92dc677d9e96ebd.jpeg)

 ![Captura de pantalla 2024-12-13 130914](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/9/7f923c386aef140a2e7fbfcb0cb8f88b35193d9d.jpeg)

Somewhere along the way i broke it, or it was already broken and i didn’t noticed, and it’s weird becase i tend to debug in almost every step of the way.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 13, 2024, 10:47am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/10 "2024-12-13T10:47:37Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/b/02bd7cb9b7471e2f580f8d47746a880a293b60b1.png)

What are you _actually_ trying to do? Hover over widgets and show a hint / tooltip?

* * *

Regarding this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/2/602d000fd39d360079bf6fde58ec33f49e22e82f.png)

This is a really bad idea, it’s not reliable. If, for some reason, you must a use an ID system, create your own ID system. Give actors tags or give widgets Name IDs. And for something more in-depth:

> **[Using Gameplay Tags in Unreal Engine | Unreal Engine 5.5 Documentation | Epic...](https://dev.epicgames.com/documentation/en-us/unreal-engine/gameplay-tags?application_version=4.27)**
>
> An overview of the hierarchical label system in Unreal Engine.

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 13, 2024, 11:11am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/11 "2024-12-13T11:11:23Z")

</div>

> [@Everynone](#):
>
> What are you _actually_ trying to do? Hover over widgets and show a hint / tooltip?

Yes, in this specific case, but the idea is to use notifiers to send the data from a widget to another without knowing about eachother, to make a modular system and send data from anyone to anyone using events.

> [@Everynone](#):
>
> Give actors tags or give widgets Name IDs

I’ll read about it and try to implement it. The more reliable the better. It’s for my own consumption, for my own ArchViz projects, and the easier, faster and more modular i can work in the end, the less headaches and debugging i’ll get, and can focus on the actual client’s needs instead of making deep changes to the UI/UX. As gamers, developers, and PC guys, we know what a setting or parameter might change if touched, but for the end customer of the product, hints and info (in this case) are a must because could be someone like us or a person without technical knowledge, and providing information on critical settings is important. Also, this is intended to show all kinds of info, like the player’s location in the floorplan, etc. and each submenu should talk to the info/hint text without knowing about the text existance, using a dispatcher, and the text needs any content on receiving the UpdateHint event.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 13, 2024, 11:39am UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/12 "2024-12-13T11:39:27Z")

</div>

> Yes, in this specific case,

Just to clarify - a fully fledged native tooltip systems already exists and is embedded into widgets. There are reasons why one’d want to create their own ofc.

> [@hdslayer1990](#):
>
> Yes, in this specific case, but the idea is to use notifiers to send the data from a widget to another without knowing about eachother, to make a modular system and send data from anyone to anyone using events.

That’s just dispatchers 101.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/6/b16149bc1d2db5c0e435d3afff08354a50da0dce.png)

Here, if the Audio Fader’s `Visibility` changed, another entity would receive a notification.

* * *

To make it work with multiple classes:

- two child classes inheriting from a base that has the dispatcher:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/8/b781312a38723c1e8bd3bba18d6c6e5a997fac7c.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/0/1508f5fd4eeeb64e30a02c0f1bb5d4037335fe28.png)

You can now send their notifies to any actor / widget / component providing the signatures of the Dispatcher & Custom Event match.

* * *

> [@hdslayer1990](#):
>
> I’m debugging step by step.

Little can be done from our side regarding this bit. We do not see the full picture. Chances are it would take significant time to convey the details. However, feel free to [rubberduck](https://en.wikipedia.org/wiki/Rubber_duck_debugging) in public until it makes sense. It works surprisingly well.

---

<div class="post-metadata">

**Author:** ![hdslayer1990](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hdslayer1990/32/1041576_2.png) [@hdslayer1990](https://forums.unrealengine.com/u/hdslayer1990)\
**Post date:** [December 13, 2024, 3:57pm UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/13 "2024-12-13T15:57:25Z")

</div>

So the solution after reparenting was to make a pure cast to the parent widget class and make a safety branch just in case and for debugging. It’s working now. As for the comparision method i just used the row name as a name ID and passed it to every widget created from the table as a Name variable and now everything is on sails))))

 ![Captura de pantalla 2024-12-13 185002](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/3/0238dd9d95a54e66d068cc5b8ad98eb0490617a4.png)  
 ![Captura de pantalla 2024-12-13 185415](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/2/9126174c88d99ab8eb5a970b47b8bb38b1e61683.png)  
 ![Captura de pantalla 2024-12-13 185428](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/c/ffc6d5044bb45a42acbeaafd86f7da8de2ff3695.png)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 12, 2025, 3:57pm UTC](https://forums.unrealengine.com/t/communication-between-widgets-using-data-driven-content/2211157/14 "2025-01-12T15:57:47Z")

</div>

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