OnClicked events for multiple dynamically created widgets that contain buttons

I have a widget blueprint that contains a uniform grid, that we can can “Panel”. I have another widget blueprint that only contains a button. I want to dynamically create as many of these widget buttons as I want in this Panel. Each button should send its own parameters to a general function that handles all the buttons. I have read all the pertinent forum posts on this matter yet all the solutions presented don’t work for some reason. I have attempted to bind to the dynamically created widget/button yet when I click nothing happens. No errors. nothing. Any help would be appreciated. Here is the the code that creates the buttons which lives in the Panel widget. Why doesn’t this work?

Did you do Call your event dispatcher in your widget button bp ?

Try to test these first:

  1. Only test your widget button bp to see if it actually clicable.
  2. Only test one child widget without the for each loop:
  3. double check you don’t have the correct visibility setting on your main widget component panel.
  4. double check any possible overlay widget.
1 Like

Thank you for your insight. As it turns out there were several problems. I had not properly created the event dispatcher. Watching this video helped me unlock a few things:
https://www.youtube.com/watch?v=r20VEPH_e0o

And I also had another widget with a canvas panel overlaying the widget with the buttons which prevented me from clicking. Making sure to add the widgets to the viewport in the correct order helped me solve that. It also helped me to start from a fresh project and create the buttons from scratch. Once I had a working version I was able to see more clearly the problem in my original project. Excellent tips for troubleshooting!

1 Like

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