nikhilbchilwant / google-web-toolkit-incubator

Automatically exported from code.google.com/p/google-web-toolkit-incubator
1 stars 1 forks source link

ValueChangeHandler registered on TimePicker.addValueChangeHandler() is never notified of change. #267

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of gwt and gwt-incubator are you using?
GWT 1.6.4 and gwt-incubator-march-02-2009.jar (revision 1539)

What OS and browser are you using?
Windows with GWT in hosted mode (IE).

Do you see this error in hosted mode, web mode, or both?
Only tried it in hosted mode.

(If possible, please include a test case that shows the problem)

Hopefully using the test case you have generously provided, what steps will 
reproduce the 
problem? 
1. Register a listener on TimePicker.addValueChangeHandler().  Add a break 
point or a log 
message on your listener so you can tell if it is ever called.
2. Open a DateTimePicker and click on a time spinner to change the time.
3.

What is the expected output? What do you see instead?
The  ValueChangeHandler that was registered should be called back, notifying it 
that the value in 
the TimePicker has changed.

Workaround if you have one:
Below is a patch that can be applied to fix the issue:

### Eclipse Workspace Patch 1.0
#P gwt-incubator
Index: src/com/google/gwt/gen2/picker/client/TimePicker.java
===========================================================
========
--- src/com/google/gwt/gen2/picker/client/TimePicker.java   (revision 1640)
+++ src/com/google/gwt/gen2/picker/client/TimePicker.java   (working copy)
@@ -52,9 +52,8 @@
     }

     protected String formatValue(long value) {
-      dateInMillis = value;
       if (dateTimeFormat != null) {
-        return dateTimeFormat.format(new Date(dateInMillis));
+        return dateTimeFormat.format(new Date(value));
       }
       return "";
     }
@@ -78,7 +77,9 @@

   private SpinnerListener listener = new SpinnerListener() {
     public void onSpinning(long value) {
-      ValueChangeEvent.fireIfNotEqual(TimePicker.this, new Date(dateInMillis),
+       long oldValue = dateInMillis;
+        dateInMillis = value;
+      ValueChangeEvent.fireIfNotEqual(TimePicker.this, new Date(oldValue),
           new Date(value));
     };
   };

Original issue reported on code.google.com by jgass...@gmail.com on 27 Apr 2009 at 12:02

GoogleCodeExporter commented 8 years ago
Hi everyone,

 This project seems a to be stopped. When is this bug going to be fixed?

Original comment by m.har...@gmail.com on 9 Sep 2009 at 8:58

GoogleCodeExporter commented 8 years ago
The project has hit a bit of a slow patch, but it isn't dead. Additionally, I 
believe 
the owner of this particular widget is no longer active on the project. I can 
try to 
make some time to look into this issue if nobody else claims it.

Original comment by itruett on 9 Sep 2009 at 9:54

GoogleCodeExporter commented 8 years ago
Being 6 months after the last comment, is this resolved now? 

Original comment by planet.j...@gmail.com on 3 Mar 2010 at 4:48

GoogleCodeExporter commented 8 years ago
going to try the provided workaround but please fix it anyways! wasted a lot of 
time until i found the part where the problem occurs!

thx and regards

Original comment by opn...@googlemail.com on 8 Feb 2011 at 8:26