GWT DateBox

GWT DateBox is a text field which pops-up date picker when we click inside. The getValue and setValue methods return/accept Date objects, not raw Strings.

GWT DateBox Syntax

GWT DateBox Nested Classes

ClassDescription
DateBox.DefaultFormatIt is the default DateBox.Format class.
DateBox.FormatIt is implemented by a delegate to handle the parsing and formatting of date values.

GWT DateBox Constructors

ConstructorDescription
DateBox()It creates a date box with a new DatePicker.
DateBox(DatePicker picker, java.util.Date date, DateBox.Format format)It creates a new date box.

GWT DateBox Common Methods

Modifier and typesMethodsDescription
HandlerRegistrationaddValueChangeHandler(ValueChangeHandler<java.util.Date> handler)It adds a ValueChangeEvent handler.
LeafValueEditor<java.util.Date>asEditor()It returns a TakesValueEditor backed by the DateBox.
intgetCursorPos()It gets the current cursor position in the date box.
DatePickergetDatePicker()It gets the date picker.
booleangetFireNullValues()It returns true iff the date box will fire ValueChangeEvents with a date value of null for invalid or empty string values.
DateBox.FormatgetFormat()It gets the format instance used to control formatting and parsing of this DateBox.
intgetTabIndex()It gets the date box's position in the tab index.
TextBoxgetTextBox()It get text box.
java.util.DategetValue()It get the date displayed, or null if the text box is empty, or cannot be interpreted.
voidhideDatePicker()It hide the date picker.
booleanisDatePickerShowing()It returns true if date picker is currently showing, false if not.
voidsetAccessKey(char key)It sets the date box's 'access key'.
voidsetFormat(DateBox.Format format)It sets the format used to control formatting and parsing of dates in this DateBox.
voidsetTabIndex(int index)It sets the date box's position in the tab index.
voidshowDatePicker()It parses the current date box's value and shows that date.

GWT DateBox Example

Output:

GWT Datebox 1
Next TopicGWT SuggestBox




Latest Courses