Reviewers: ecc,

Description:
Description:
============
The native file input element supports change events, which are very
useful to automatically submit a form when the user selects a file.
FileUpload should implement HasChangeHandlers to take advantage of this.


Fix:
====
FileUpload now implements HasChangeHandlers.  This would have been a
trivial change except...

Native file upload implementations differ slightly between browsers
(some have text boxes, others don't), but the change event is fired
exactly when you'd expect it to be on all browsers except Opera.  Opera
fires the change event every time the user types a character, which is
inconsistent with other browsers and with the native text box.  I added
an impl class that saves the last change event internally and fires it
only when the input element is blurred, which is consistent with text
boxes.  Unfortunately, this means that if the user selects a file
through the file chooser in Opera, a change event will not fire until
the user blurs the file upload element.  However, this is a minor
difference, its perfectly reasonable, and it only affects Opera.

I verified that the impl class is compiled out on other browsers.


Testing:
=======
I tested this manually on all browsers and added a code museum issue.

Please review this at http://gwt-code-reviews.appspot.com/1802

Affected files:
    
reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/Issue3187.java
   user/src/com/google/gwt/user/FileUpload.gwt.xml
   user/src/com/google/gwt/user/User.gwt.xml
   user/src/com/google/gwt/user/client/ui/FileUpload.java



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to