Hi!

Try this:

public class DoubleClickListBox extends ListBox implements
HasDoubleClickHandlers{

    public DoubleClickListBox(boolean isMultipleSelect) {
        super(isMultipleSelect);
    }

    public DoubleClickListBox() {
        super();
    }

    public HandlerRegistration addDoubleClickHandler
(DoubleClickHandler handler) {
        return addDomHandler(handler, DoubleClickEvent.getType());
    }
}


On 4 Jun., 23:12, Transplant <[email protected]> wrote:
> Is there an "approved" method for trapping double click on a widget
> (specifically a ListBox element) in GWT 1.6. I had been using
> sinkEvents/onBrowserEvent technique originally presented
> <a href="http://groups.google.com/group/Google-Web-Toolkit/
> browse_thread/thread/2cbc631e306be73b/2dfc0c7297e4bb6f?lnk=gst&q=double
> +click#2dfc0c7297e4bb6f"here</a>
> but that doesnt seem to work anymore on IE6. Still seems to work
> everywhere else though. Does anyone know if there is a New And Improved
> (TM) way to do this with the new event handlers in GWT 1.6??
>
> Thanks in advance!
>
> /** Double Click Sample **/
> class DoubleClickListBox extends ListBox
> {
>
> public DoubleClickListBox () {
>         super (true);}
>
> protected void onLoad() {
>     sinkEvents(Event.ONDBLCLICK);
>
> }
>
> public void onBrowserEvent (Event event) {
>         if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
>                 Element target = DOM.eventGetTarget(event);
>                 // Firefox targets OPTION, IE targets SELECT
>
>                 if (DOM.getElementProperty (target, 
> "tagName").equals("OPTION")) {
>                         target = DOM.getParent(target);
>                 }
>                 if (this.getElement().equals(target)) {
>                         processDoubleClickSomewhere ();
>                 }
>         }
>         else
>                 super.onBrowserEvent (event);
>
> }
> }
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to