Class AbstractDateTextField<T,P extends TextField<T> & AbstractTextComponent.ITextFormatProvider,I,C extends AbstractDateTextFieldConfig<C,I>,F extends AbstractDateTextField<T,P,I,C,F>>

Type Parameters:
T - the type of date (java.util.Date or java.time.LocalDate)
P - the type of the parent wicket TextField working with date of type T
I - the input date type for the configuration options withBeginDate or withEndDate
C - the configuration - the concrete implementation of the AbstractDateTextFieldConfig
F - the concrete implementation type of this abstract class
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,FormComponent<T>>, IMetadataContext<Serializable,Component>, AbstractTextComponent.ITextFormatProvider, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
DateTextField, LocalDateTextField

public abstract class AbstractDateTextField<T,P extends TextField<T> & AbstractTextComponent.ITextFormatProvider,I,C extends AbstractDateTextFieldConfig<C,I>,F extends AbstractDateTextField<T,P,I,C,F>> extends TextField<T> implements AbstractTextComponent.ITextFormatProvider
Abstract base class providing the common aspects of the different kinds of DateTextFields which are based on different date types. This class applies composition over inheritance applying the delegation pattern: It contains an instance of the original wicket date text field class backing the converter.
Author:
miha, Urs Joss
See Also:
  • Constructor Details

    • AbstractDateTextField

      protected AbstractDateTextField(P wicketTextField, Class<T> implementingDateTextFieldClass, C config)
      Super constructor that needs to be called from the implementing classes
      Parameters:
      wicketTextField - The parent non-bootstrap wicket implementation of the DateTextField.
      implementingDateTextFieldClass - the concrete type of the date text field class inheriting from this abstract base class
      config - the configuration
  • Method Details

    • getConfig

      public C getConfig()
      Returns:
      the configuration of the date text field
    • with

      public F with(C config)
      sets the configuration in a fluent style
      Parameters:
      config - the configuration
      Returns:
      this
    • getTextFormat

      public String getTextFormat()
      Specified by:
      getTextFormat in interface AbstractTextComponent.ITextFormatProvider
    • getConverter

      public <C> IConverter<C> getConverter(Class<C> type)
      Specified by:
      getConverter in interface IConverterLocator
      Overrides:
      getConverter in class Component
    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class MarkupContainer
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class TextField<T>
    • renderHead

      public void renderHead(IHeaderResponse response)
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component
    • createScript

      protected CharSequence createScript(C config)
      creates the initializer script.
      Returns:
      initializer script
    • addEvent

      Allows to register/add an event handler.
      Parameters:
      type - The event type
      handler - he event type
      Returns:
      this
    • addAjaxEvent

      public F addAjaxEvent(AbstractDateTextField.Event type, de.agilecoders.wicket.extensions.markup.html.bootstrap.form.AbstractDateTextField.IParentAjaxEventHandler evenHandler)
      Adds and ajax based event. Model object is not updated.
      Parameters:
      type - the event type
      evenHandler - The event handler
    • addAjaxEvent

      public F addAjaxEvent(AbstractDateTextField.Event type, de.agilecoders.wicket.extensions.markup.html.bootstrap.form.AbstractDateTextField.IParentAjaxEventHandler evenHandler, boolean updateModel)
      Adds and ajax based event
      Parameters:
      type - the event type
      evenHandler - The event handler
      updateModel - if model object should be updated when even is fired
    • removeEvent

      public F removeEvent(AbstractDateTextField.Event type)
      Allows to remove an event handler
      Parameters:
      type - The event type
      Returns:
      this
    • getDestroyScript

      public String getDestroyScript()