i want to create a handler for a superwidget which handles onclick events for subwidgets.
Is there a option to do this?
For example:
I want to register a Clickhandler to a absoultePanel. The absolutePanel contains different Image-Widgets.
Of cause, i could register the handler for each image, but i need the same handler for each image because i need some global informations.
i thought i can do something like this:
if (event.getSource() instanceof Image) but it works not for me
Greetz,
destiny
In response to your attempt,
event.getSource()will return the widget the handler was attached to. In your case, the absolute panel.That said, If you want to attach the same handler to all of your images, there is nothing stopping you from doing this:
That said, if you still want to add the click handler to the image containment panel, consider this: