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 type
I - 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:
  • Field Details

    • StartDate

      protected static final de.agilecoders.wicket.jquery.IKey<String> StartDate
      The earliest date that may be selected; all earlier dates will be disabled.
    • EndDate

      protected static final de.agilecoders.wicket.jquery.IKey<String> EndDate
      The latest date that may be selected; all later dates will be disabled.
  • Constructor Details

    • AbstractDateTextFieldConfig

      public AbstractDateTextFieldConfig()
  • Method Details

    • getFormat

      public String getFormat()
      Returns:
      the date format as string
    • getLanguage

      public String getLanguage()
      Returns:
      the language to use
    • isDefaultLanguageSet

      public boolean isDefaultLanguageSet()
      Returns:
      true if default language should be used.
    • withStartDate

      public abstract C withStartDate(I value)
      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

      public C withMinViewMode(AbstractDateTextFieldConfig.View minViewMode)
      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

      public abstract C withEndDate(I value)
      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

      public C withLanguage(String value)
      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

      public C withView(AbstractDateTextFieldConfig.View value)
      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

      public C withFormat(String value)
      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

      public C withWeekStart(AbstractDateTextFieldConfig.Day value)
      Day of the week start. 0 (Sunday) to 6 (Saturday)
      Parameters:
      value - the AbstractDateTextFieldConfig.Day the week starts
      Returns:
      this instance for chaining
    • allowKeyboardNavigation

      public C allowKeyboardNavigation(boolean value)
      Whether or not to allow date navigation by arrow keys.
      Parameters:
      value - true, if keyboard navigation is allowed
      Returns:
      this instance for chaining
    • highlightToday

      public C highlightToday(boolean value)
      If true, highlights the current date.
      Parameters:
      value - If true, highlights the current date.
      Returns:
      this instance for chaining
    • showTodayButton

      public C showTodayButton(AbstractDateTextFieldConfig.TodayButton value)
      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

      public C forceParse(boolean value)
      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

      public C clearButton(boolean value)
      Parameters:
      value - Whether or not to display a 'clear' button, which allows for clearing the input field.
      Returns:
      this instance for chaining
    • calendarWeeks

      public C calendarWeeks(boolean value)
      Parameters:
      value - Whether or not to show week numbers to the left of week rows.
      Returns:
      this instance for chaining
    • autoClose

      public C autoClose(boolean value)
      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

      public C withMulti(boolean value)
      Whether multi date selection is enabled.
      Parameters:
      value - true, if datepicker should accept multiple selections
      Returns:
      this instance for chaining