PDA

View Full Version : How to handle dblclick event in a Field?



mariusz.pala
20 Jan 2009, 8:29 AM
Hi, I'm trying to catch the double click event in a field, but it doesn't work.

That's my code:

ListField<SimpleValueModel> control = new ListField<SimpleValueModel>();
control.addListener(Event.ONDBLCLICK, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
Info.display("test", "double clicked");
};
});The same with TextField.

Is there any way to do that?

Thanks,
Mariusz

mariusz.pala
20 Jan 2009, 8:38 AM
OK, I found the solution, but this is inconsistient, onclick event can be catched from the ListField, but the ondoubleclick can be handled only from the ListView:


control.getListView().addListener(Events.OnDoubleClick, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {

Info.display("test", "double clicked");
};
});

kolli
20 Jan 2009, 11:29 AM
I think the double click can be added to the set of events for ListField
this thread might help. http://www.extjs.com/forum/showthread.php?t=53670.

you can even check the gxt FAQ to learn more about sinking the events.