Hi,

I've just detecting a problem with the datebox widget with GWT 2.0,
the widget works well but when I set a format to the datebox two value
change events are handled by the datebox.

Does anyone 's got a solution or know that is a bug already known by
the GWT team ?

(Except the solution that need to write more code in using
db.getDatePicker().addValueChangeHandler +  db.getTextBox
().addValueChangeHandler)

Regards,


A small piece of code to see the behaviour :

                        public static final Format dateboxFormat=new 
DateBox.DefaultFormat
(DateTimeFormat.getFormat("dd/MM/yyyy"));

                        [...]

                        DateBox db=new DateBox();
                        db.setFormat(dateboxFormat);
                        fp.add(db);

                        // After selecting a date on the datepicker popup
                        db.getDatePicker().addValueChangeHandler(new
ValueChangeHandler<Date>() {

                                @Override
                                public void 
onValueChange(ValueChangeEvent<Date> event) {
                                        Window.alert("datepicker");

                                }
                        });
                        // After editing manually the date in the textbox
                        db.getTextBox().addValueChangeHandler(new 
ValueChangeHandler<String>
() {

                                @Override
                                public void 
onValueChange(ValueChangeEvent<String> event) {
                                        Window.alert("text");

                                }
                        });
                        // After selecting a date on the datepicker popup OR 
editing
manually the date in the textbox
                        // Two events are triggered for one date change when a 
setFormat
(...) is set to a datebox.
                        db.addValueChangeHandler(new ValueChangeHandler<Date>() 
{

                                @Override
                                public void 
onValueChange(ValueChangeEvent<Date> event) {
                                        Window.alert("datebox"); //Got it twice 
for one date editing

                                }
                        });

--

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