hello,

I am developing a project and have a problem.

I use org.gwt.advanced.client.ui.widget.DatePicker and when I call the 
function setDate (NewDate), the new date is not updated until I open the panel 
for the second time.

Help please!

Code:

DatePicker StartDateTime;

protected ChangeHandler startChangeHandler = new ChangeHandler() {
        public void onChange(ChangeEvent event) {
            try {
                DateTimeFormat fmt = DateTimeFormat
                        .getFormat("dd/MM/yyyy HH:mm:ss");
                String error = "";
                labelError.setText("");
                Date maxDate = new Date(new Date().getTime()
                        + new Long("31536000000").longValue());
                if (StartDateTime.getDate().after(maxDate)) {
                    fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
                    error = "Maximum date is: "
                            + fmt.format(maxDate).toString()
                            + "\nThe Start date is too far away to wait: "
                            + 
fmt.format(StartDateTime.getDate()).toString();
                    labelError.setText(error);
                }

            } catch (IllegalArgumentException e) {
                String error = "Error Start date: " + e.toString()
                        + ". Contact your Administrator.";
                labelError.setText(error);
            }
        }
    };

this.StartDateTime = new DatePicker();
this.StartDateTime.setTimeVisible(true);
this.StartDateTime.addChangeHandler(startChangeHandler);



protected void selectModul(Modul modul) {
        this.StartDateTime.setDate(modul.startTime);
}



Thank you.






-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/D4zzXeAplb4J.
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