I'm using GWT 2.0. I've extended DecoratorPanel in order to add a
title bar which contains a title and a number of pushbuttons/images.
I've run into an issue here because when I add an image to the header
bar as follows:
image.addClickHandler(handler);
image.sinkEvents(Event.KEYEVENTS);
image.setStyleName(style);
DOM.appendChild(titleBarElement, image.getElement());
adopt(image);
the image appears fine on the title bar but the associated click
handler does not work at all. Can anybody provide any further info
here?
I initially tried to add a PushButton (instead of an Image), but that
was worse : ) because the image was not rendered correctly on the
title bar, in fact it was completely missing, despite adding the image
to the PushButton via the constructor.
PushButton pushButton = new PushButton(image);
pushButton.addClickHandler(handler);
pushButton.setStyleName(style);
DOM.appendChild(titleBarElement, pushButton.getElement());
adopt(pushButton);
Many thanks,
Jon.