Revision: 9060
Author: jlaba...@google.com
Date: Thu Oct 14 06:02:05 2010
Log: Fixing a bug in DatePickerCell where selecting a new date does not update the cell.
http://gwt-code-reviews.appspot.com/996801/show

Review by: rchan...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=9060

Modified:
 /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java

=======================================
--- /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java Tue Oct 12 07:55:56 2010 +++ /trunk/user/src/com/google/gwt/cell/client/DatePickerCell.java Thu Oct 14 06:02:05 2010
@@ -137,10 +137,16 @@
     // Hide the panel and call valueUpdater.update when a date is selected
     datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
       public void onValueChange(ValueChangeEvent<Date> event) {
+        // Remember the values before hiding the popup.
+        Element cellParent = lastParent;
+        Date oldValue = lastValue;
+        Object key = lastKey;
         panel.hide();
+
+        // Update the cell and value updater.
         Date date = event.getValue();
-        setViewData(lastKey, date);
-        setValue(lastParent, lastValue, lastKey);
+        setViewData(key, date);
+        setValue(cellParent, oldValue, key);
         if (valueUpdater != null) {
           valueUpdater.update(date);
         }

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

Reply via email to