I'm trying to impement range input widget (slider) used in conjunction with 
textbox. I want the textbox to display value chosen by the slider while the 
mouse is dragging. This would be very easy if I could register on ONINPUT 
events. Unfortunately it's not an option currently..

W dniu poniedziałek, 27 grudnia 2010 20:08:14 UTC+1 użytkownik Robert 
Staats napisał:
>
> Reviewers: ,
>
> Description:
> I used Issue 51810 as my template for this
> (http://gwt-code-reviews.appspot.com/51810).
>
> I use sinkEvents to catch onPaste events to a TextBox so I can react to
> changes on TextBoxes without waiting for it to loose focus. This works well
> for IE and Firefox but Opera does not support onPaste.
>
> Opera has an onInput event that provides a way to detect a TextBox change.
> This patch allows the onInput event to be detected in GWT.
>
> Please review this at http://gwt-code-reviews.appspot.com/1248801/show
>
> Affected files:
>    user/src/com/google/gwt/user/client/Event.java
>    user/src/com/google/gwt/user/client/impl/DOMImpl.java
>    user/src/com/google/gwt/user/client/impl/DOMImplOpera.java
>    user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
>    user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
>
>
> Index: user/src/com/google/gwt/user/client/impl/DOMImpl.java
> ===================================================================
> --- user/src/com/google/gwt/user/client/impl/DOMImpl.java        (revision
> 9483)
> +++ user/src/com/google/gwt/user/client/impl/DOMImpl.java        (working
> copy)
> @@ -92,6 +92,7 @@
>       case "gesturestart": return 0x1000000;
>       case "gesturechange": return 0x2000000;
>       case "gestureend": return 0x4000000;
> +        case "input": return 0x8000000;
>       default: return -1;
>       }
>     }-*/;
> Index: user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
> ===================================================================
> --- user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
> (revision  
> 9483)
> +++ user/src/com/google/gwt/user/client/impl/DOMImplStandard.java
> (working  
> copy)
> @@ -271,6 +271,8 @@
>           @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
>
> null;
>       if (chMask & 0x4000000) elem.ongestureend    = (bits & 0x4000000) ?
>           @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
>
> null;
> +        if (chMask & 0x8000000) elem.oninput       = (bits & 0x8000000) ?
> +        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : 
>  
> null;
>     }-*/;
>
>     private native void releaseCaptureImpl(Element elem) /*-{
> Index: user/src/com/google/gwt/user/client/impl/DOMImplOpera.java
> ===================================================================
> --- 
> user/src/com/google/gwt/user/client/impl/DOMImplOpera.java        (revision 
>  
> 9483)
> +++ 
> user/src/com/google/gwt/user/client/impl/DOMImplOpera.java        (working  
> copy)
> @@ -68,5 +68,7 @@
>           @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
>
> null;
>       elem.onpaste       = (bits & 0x80000) ?
>           @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent :
>
> null;
> +        elem.oninput       = (bits & 0x8000000) ?
> +        @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent : 
>  
> null;
>     }-*/;
>   }
> Index: user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
> ===================================================================
> --- user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
> (revision  
> 9483)
> +++ user/src/com/google/gwt/user/client/impl/DOMImplTrident.java
> (working  
> copy)
> @@ -278,5 +278,7 @@
>            
> @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null;
>       if (chMask & 0x80000) elem.onpaste       = (bits & 0x80000) ?
>            
> @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null;
> +        if (chMask & 0x8000000) elem.oninput       = (bits & 0x8000000) ?
> +         
> @com.google.gwt.user.client.impl.DOMImplTrident::callDispatchEvent : null;
>     }-*/;
>   }
> Index: user/src/com/google/gwt/user/client/Event.java
> ===================================================================
> --- user/src/com/google/gwt/user/client/Event.java        (revision 9483)
> +++ user/src/com/google/gwt/user/client/Event.java        (working copy)
> @@ -272,6 +272,15 @@
>      */
>     public static final int ONGESTURESTART = 0x1000000;
>
> +   /**
> +   * Fired when the contents of a textarea, input:text, input:password or
> +   * input:search element have changed, because the onchange event on 
> these
> +   * elements fires when the element loses focus, not immediately after
> the modification.
> +   *
> +   * Note: This event is <em>not</em> supported on Internet Explorer.
> +   */
> +  public static final int ONINPUT = 0x8000000;
> +
>     /**
>      * Fired when the user depresses a key.
>      */
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/73d888c2-6d1d-459a-ba20-0737ed77e094%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to