Tuesday, March 10, 2015

Gwt Editors: How to change a value programmatically

Hi everyone,

I got the following problem:

I got a datebox that has the following format: DateTimeFormat.PredefinedFormat.TIME_SHORT. The input-field shows: 00:22
I also got a datepicker. By changing the datepickers value, i want to update the day/month/year part of the datebox.

The following dont work (because the day/month/year is not displayed in the datebox):

OnValue change of the datepicker, I do the following:
            //get the values
            Date selectedDate = getView().getDateSelector().getValue();
            Date startDate = getView().getStart().getValue();

            // Copy day/month/year to the datebox
            startDate.setYear(selectedDate.getYear());
            startDate.setMonth(selectedDate.getMonth());
            startDate.setDate(selectedDate.getDate());

            getView().getStart().setValue(startDate);

When I update day/month/year, it doesnt work (stays unchanged). Updating hours/minutes is no problem...
I use gwt editors framework. So, how to change the date the editors way?

Thanks in advance.

Regards,
Manuel

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment