Blueprint Interface not working with UMG

I thought I knew how to use a Blueprint Interface but apparently not.
I’ve got a main widget with a child widget of a search field.

I created an interface with a function called FirstNameSearchCommitted then inside my search field widget I add the interface and then call the FirstNameSearchCommitted function with an interface call.

Inside my parent widget, I create the event for FirstNameSearchCommitted and run a simple print string but it never fires.

I’ve noticed that the target pin for the interface call is a faded yellow/green which I’ve never seen before (normally it’s blue) but I can’t seem to plug anything into the target slot so I just left it as self, which I thought would work.

Anyone know what I’m doing wrong?

How else would you communicate with a parent widget from within the child if you don’t always know what the parent will be?

Thanks!

You do need a target for it. If the child widget implements the interface, then place a reference to the child widget and pull off from there to create the FirstNameSearchCommited node.

Hey, thanks for replying. Oh, that’s why I wasn’t able to call the function correctly, I implemented the interface in both widgets :stuck_out_tongue:
Okay so I updated to only implement the BPI inside the parent widget now and then for the target in the child I used a GetParent node but this isn’t working. Aside from using a GetAllActorsOfClass, how can you reference the parent widget inside another widget that doesn’t yet know it’s a child?
I’ve tested it with the GetAllActorsOfClass node and it works now, but I don’t want to have to use that because I’d like to be able to have multiple instances of the actor in a scene to make this more dynamic and re-useable.

How do these widgets get created? If the parent widget creates the child widget, then it can also give the child a reference to it. This way, the two both have a reference to each other and can call the other’s public functions, no interface needed.

An interface is generally useful when you don’t know the type of the object you’re calling on, as it could be one of many. But this sounds like you only want to link the two, and that they always come in pairs like this. So I would get rid of the interface and give them references to each other for a simpler, more direct method.

What I was doing was I created several elements of my HUD as standalone widgets so that they could be re-used as I needed. So inside the Parent Widget, I simply added the other child widgets to the canvas but I realized with buttons inside a child widget, for example, I couldn’t affect elements that were specific to the parent widget because the child has no idea that the parent exists. So if I place some text inside the parent widget and then I want to change the text on a button press inside the child widget, I have no idea how to code it. Should I just create a reference variable of the parent inside each of the child widgets? Is that how it’s done? Yeah, that would probably work. I think I was just too tired to figure that out the other night :stuck_out_tongue: