# Bind event in main widget without reference to child widget with the event

**URL:** <https://forums.unrealengine.com/t/bind-event-in-main-widget-without-reference-to-child-widget-with-the-event/781587>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question, UMG\
**Created:** [March 2, 2023, 12:02am UTC](https://forums.unrealengine.com/t/bind-event-in-main-widget-without-reference-to-child-widget-with-the-event/781587 "2023-03-02T00:02:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huncowboy1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huncowboy1](https://forums.unrealengine.com/u/Huncowboy1)\
**Post date:** [March 2, 2023, 12:02am UTC](https://forums.unrealengine.com/t/bind-event-in-main-widget-without-reference-to-child-widget-with-the-event/781587/1 "2023-03-02T00:02:36Z")

</div>

Hi,

New to BPs and UE.

I have a main widget that has several child widgets.

> WB\_Main
> 
> > WB\_Grid
> > 
> > > [WB\_Item]

WB\_Grid is a variable to WB\_Main. The WB\_Item child widgets are added in at runtime to WB\_Grid. I would like to notify WB\_Main that a double click happened on WB\_Item so WB\_Main can display a window with data. But WB\_Main does not have an array where it keeps track of WB\_Item. WB\_Main has no WB\_Item variable either. Of course it has reference to WB\_Grid and WB\_Item is a child of that. WB\_Grid also has no variable references to WB\_Item.

It seams there is no way to directly bind WB\_Main to this event dispatched by WB\_Item. The event does not show when I right click in the BP editor. Unless I am missing something.

What is best practice for such case? I guess I could create an array in WB\_Main and keep track of items and bind to their event as they populate the array and unbind as they get removed. But that feels wrong to me. I could also have WB\_Item find WB\_Main as parent of a parent through a bunch of loops, and then call a function in it, but that sounds even worse. WB\_Item should not know about WB\_Main as a principle. But maybe I am wrong. Maybe I just need a beer.

Thank you! Sorry I am new to UE.

---

<div class="post-metadata">

**Author:** ![Supremative](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/supremative/32/906564_2.png) [@Supremative](https://forums.unrealengine.com/u/Supremative)\
**Post date:** [March 2, 2023, 4:35am UTC](https://forums.unrealengine.com/t/bind-event-in-main-widget-without-reference-to-child-widget-with-the-event/781587/2 "2023-03-02T04:35:28Z")

</div>

Look at this, please.

> [@UMG Widget 'Event Drilling'](https://forums.unrealengine.com/t/umg-widget-event-drilling/768062/3):
>
> You could drill a widget tree in the following way: Create BlueprintInterface to send events to desired widgets: Add the interface to your widgets: [image] Create a macro library with the following macro: Use the macro to send events from the bottom widget to every upper widget in the tree that does implement the interface: Catch event: Example: Widget Tree: [image] [image] [image] Runtime: [Drill] [My Products](https://www.unrealengine.com/marketplace/en-US/profile/Aleksandr+Sidorov)

---

<div class="post-metadata">

**Author:** ![Huncowboy1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huncowboy1](https://forums.unrealengine.com/u/Huncowboy1)\
**Post date:** [March 3, 2023, 3:11am UTC](https://forums.unrealengine.com/t/bind-event-in-main-widget-without-reference-to-child-widget-with-the-event/781587/3 "2023-03-03T03:11:15Z")

</div>

Thank you for the reply and for the code! Looping until you find the widget you need is a workaround. I might have to do something like that. But I was after a built in solution.

Your link did lead me to UMG Viewmodel here:

> **[UMG Viewmodel](https://docs.unrealengine.com/5.1/en-US/umg-viewmodel/)**
>
> Use Viewmodels to handle events and maintain a manifest for the variables in your UI.

Which might be the way to go, I just had no time to dive in and I also found no examples yet.
