How to make public event in custom widget?

Hello. I have custom widget with structure like this:
image
I’m using that custom widget in another widget where I have widget switcher and I want to create event like “on button click” for custom widget to call it from main widget. But now my custom widget only have that:
image
How to add something like “on widget clicked” event?

You should add a dispatcher event:

image

And call it when you want to fire:

image

image

My Products

1 Like

Sorry, I can’t make it work. I created dispatcher, but don’t know how to use it. I made this inside main widget
image
, but I don’t know what to do inside custom widget.

1 Like

Thank you! It worked! I created another solution (it won’t work if you have more than 1 widget switcher):


but your’s better, so I’ll use it.