PDA

View Full Version : LayoucContainer + ClickListener ?



valery.stroeder
30 Jun 2010, 11:55 PM
Hello,

I would like to add a listener on a simple LayoutContainer. This listener should be called when the container is clicked. I tried this :



LayoutContainer lc = new LayoutContainer;
lc.addListener(Events.OnClick, new Listener<BaseEvent>() {
@Override
public void handleEvent(final BaseEvent componentEvent) {
MessageBox.info("OK","container clicked",null);
}
}


The event is never called...

sven
1 Jul 2010, 12:12 AM
No because you have not used the forum search and are missing GWT basics:

lc.sinkEvents(Event.ONCLICK);

valery.stroeder
1 Jul 2010, 5:40 AM
Thank you very much for your answer. It is exactly what I need.