Module wicket.bootstrap.extensions
Class AbstractDateTextFieldConfig<C extends AbstractDateTextFieldConfig,I>
java.lang.Object
de.agilecoders.wicket.jquery.CombinableConfig
de.agilecoders.wicket.jquery.AbstractConfig
de.agilecoders.wicket.extensions.markup.html.bootstrap.form.AbstractDateTextFieldConfig<C,I>
- Type Parameters:
C- The concrete configuration typeI- the date type used as input for the with{Begin,End}Date methods
- All Implemented Interfaces:
de.agilecoders.wicket.jquery.Config,Serializable,IClusterable
- Direct Known Subclasses:
DateTextFieldConfig,LocalDateTextFieldConfig
public abstract class AbstractDateTextFieldConfig<C extends AbstractDateTextFieldConfig,I>
extends de.agilecoders.wicket.jquery.AbstractConfig
Abstract base class for implementations of
*DateTextFields, i.e. for implementations
working with java.util.Date or java.time.LocalDate.This class provides the common
infrastructure that does not depend on the type of date being implemented.- Author:
- miha, Urs Joss
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumholds all week days in a specific sort order.static enumSee docs.static enumholds all view options. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final de.agilecoders.wicket.jquery.IKey<String>The latest date that may be selected; all later dates will be disabled.protected static final de.agilecoders.wicket.jquery.IKey<String>The earliest date that may be selected; all earlier dates will be disabled. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowKeyboardNavigation(boolean value) Whether or not to allow date navigation by arrow keys.autoClose(boolean value) Whether or not to close the datepicker immediately when a date is selected.calendarWeeks(boolean value) clearButton(boolean value) forceParse(boolean value) Whether or not to force parsing of the input value when the picker is closed.highlightToday(boolean value) If true, highlights the current date.booleanIf true, displays a "Today" button at the bottom of the datepicker to select the current date.abstract CwithEndDate(I value) The latest date that may be selected; all later dates will be disabled.withFormat(String value) The date format (java style), combination of d, dd, m, mm, M, MM, yy, yyyy.withLanguage(String value) The two-letter code of the language to use for month and day names.withMinViewMode(AbstractDateTextFieldConfig.View minViewMode) Sets the minimal view of the date pickerwithMulti(boolean value) Whether multi date selection is enabled.abstract CwithStartDate(I value) The earliest date that may be selected; all earlier dates will be disabled.The view that the datepicker should show when it is opened.Day of the week start. 0 (Sunday) to 6 (Saturday)Methods inherited from class de.agilecoders.wicket.jquery.AbstractConfig
all, contains, get, getString, isEmpty, newKey, put, remove, toJsonString, wrapMethods inherited from class de.agilecoders.wicket.jquery.CombinableConfig
combine, withFallback
-
Field Details
-
StartDate
The earliest date that may be selected; all earlier dates will be disabled. -
EndDate
The latest date that may be selected; all later dates will be disabled.
-
-
Constructor Details
-
AbstractDateTextFieldConfig
public AbstractDateTextFieldConfig()
-
-
Method Details
-
getFormat
- Returns:
- the date format as string
-
getLanguage
- Returns:
- the language to use
-
isDefaultLanguageSet
public boolean isDefaultLanguageSet()- Returns:
- true if default language should be used.
-
withStartDate
The earliest date that may be selected; all earlier dates will be disabled.- Parameters:
value- the earliest start date- Returns:
- this instance for chaining
-
withMinViewMode
Sets the minimal view of the date picker- Parameters:
minViewMode- the minimal view (View.Decade is not supported and will be handle as Day)- Returns:
- this instance for chaining
-
withEndDate
The latest date that may be selected; all later dates will be disabled.- Parameters:
value- the latest end date- Returns:
- this instance for chaining
-
withLanguage
The two-letter code of the language to use for month and day names. These will also be used as the input's value (and subsequently sent to the server in the case of form submissions). Currently ships with English ('en'), German ('de'), Brazilian ('br'), and Spanish ('es') translations, but others can be added (see I18N below). If an unknown language code is given, English will be used.- Parameters:
value- two letter language code (optional 5 letter code like de_DE)- Returns:
- this instance for chaining
-
withView
The view that the datepicker should show when it is opened. Accepts values of 0 or 'month' for month view (the default), 1 or 'year' for the 12-month overview, and 2 or 'decade' for the 10-year overview. Useful for date-of-birth datepicker.- Parameters:
value- the start view to use- Returns:
- this instance for chaining
-
withFormat
The date format (java style), combination of d, dd, m, mm, M, MM, yy, yyyy.- Parameters:
value- The date format value (java style)- Returns:
- this instance for chaining
-
withWeekStart
Day of the week start. 0 (Sunday) to 6 (Saturday)- Parameters:
value- theAbstractDateTextFieldConfig.Daythe week starts- Returns:
- this instance for chaining
-
highlightToday
If true, highlights the current date.- Parameters:
value- If true, highlights the current date.- Returns:
- this instance for chaining
-
showTodayButton
If true, displays a "Today" button at the bottom of the datepicker to select the current date. If true, the "Today" button will only move the current date into view;- Parameters:
value- whether to show today button or not- Returns:
- this instance for chaining
-
forceParse
Whether or not to force parsing of the input value when the picker is closed. That is, when an invalid date is left in the input field by the user, the picker will forcibly parse that value, and set the input's value to the new, valid date, conforming to the given format.- Parameters:
value- Whether or not to force parsing of the input value when the picker is closed- Returns:
- this instance for chaining
-
clearButton
- Parameters:
value- Whether or not to display a 'clear' button, which allows for clearing the input field.- Returns:
- this instance for chaining
-
calendarWeeks
- Parameters:
value- Whether or not to show week numbers to the left of week rows.- Returns:
- this instance for chaining
-
autoClose
Whether or not to close the datepicker immediately when a date is selected.- Parameters:
value- true, if datepicker should close immediately when date is selected.- Returns:
- this instance for chaining
-
withMulti
Whether multi date selection is enabled.- Parameters:
value- true, if datepicker should accept multiple selections- Returns:
- this instance for chaining
-