DecoratorPanel subclass and Widgets

7 views
Skip to first unread message

jonathan...@gmail.com

unread,
Jan 14, 2010, 6:25:49 PM1/14/10
to Google Web Toolkit
Hi all,

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.


Reply all
Reply to author
Forward
0 new messages