PDA

View Full Version : How could i catch double click event in gxt?



zsumore
13 May 2008, 12:07 AM
How could i catch double click event in gxt?

gslender
13 May 2008, 1:00 AM
against what?

zsumore
13 May 2008, 5:55 AM
I want to catch double click event in TabPanel.
how could i do?

darrellmeyer
13 May 2008, 7:06 AM
There 2 things that need to done to listen to any browser event:

1. Add a listener for the event type
2. Ensure the component is sinking the event type (TabPanel does not sink double click)


TabPanel tabPanel = new TabPanel() {
@Override
protected void afterRender() {
super.afterRender();
el().addEventsSunk(Events.OnDoubleClick);
}
};
tabPanel.addListener(Events.OnDoubleClick, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent be) {
GWT.log("double click", null);
}
});