A DateBox where I can select the time and hide the DatePicker

664 views
Skip to first unread message

Alexander Orlov

unread,
Sep 19, 2011, 3:46:51 AM9/19/11
to google-we...@googlegroups.com
                    final DateBox.Format format = new DateBox.DefaultFormat(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.TIME_SHORT));
                    begin.setFormat(format);
                    begin.hideDatePicker();

I have two problems with this DateBox
  1. I don't want it to show the DatePicker and although begin.isDatePickerShowing() reports false, every time I click on the DateBox the DatePicker comes down
  2. I want let the DatePicker not show the Calendar but a "TimeSelector" (I suppose it's not possible?)
To "hide" the DatePicker I could also use a TextBox but in this particular case a semantic Date widget would be nice to use.
Screen Shot 2011-09-19 at 9.36.44 AM.png

Thad

unread,
Sep 19, 2011, 3:06:53 PM9/19/11
to Google Web Toolkit
The now discontinued GWT Incubator project had a Time option for its
DatePicker:

http://code.google.com/docreader/#p=google-web-toolkit-incubator&s=google-web-toolkit-incubator&t=Spinner

I dunno why the GWT didn't pick up on this feature, but they didn't.

I was using the Incubator's date-time picker before GWT introduced
DatePicker, and I still need a time selector. I now use
com.google.gwt.gen2.picker.client.DateTimePicker. Its DatePicker is
from the trunk, its TimePicker is its own (per javadoc, "TimePicker
widget to enter the time part of a date using spinners").

Since this project is no longer supported, you'll have to spend some
time with the source to remove the classes that no longer compile with
GWT.

On Sep 19, 3:46 am, Alexander Orlov <alexander.or...@loxal.net> wrote:
>                     final DateBox.Format format = new
> DateBox.DefaultFormat(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.TIME_SHORT));
>                     begin.setFormat(format);
>                     begin.hideDatePicker();
>
> I have two problems with this DateBox
>
>    1. I don't want it to show the DatePicker and although *
>    begin.isDatePickerShowing()* reports *false,* every time I click on the
>    DateBox the DatePicker comes down
>    2. I want let the DatePicker not show the Calendar but a "TimeSelector"
>    (I suppose it's not possible?)
>
> To "hide" the DatePicker I could also use a TextBox but in this particular
> case a semantic Date widget would be nice to use.
>
>  Screen Shot 2011-09-19 at 9.36.44 AM.png
> 12KViewDownload

Alexander Orlov

unread,
Sep 20, 2011, 3:00:05 AM9/20/11
to google-we...@googlegroups.com
Thx, however I try to avoid third-party extensions as much as possible. Really, with time their maintenance can become the biggest pain in ones behind. So I suppose, I have to use a TextBox.

Piotr Morgwai Kotarbinski

unread,
Oct 13, 2016, 11:30:54 AM10/13/16
to GWT Users
it's a veeeery old thread, but seems many ppl still have the same problem, so regarding 1:
begin.getDatePicker().setVisible(false);


Reply all
Reply to author
Forward
0 new messages