All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<Date,FormComponent<Date>>, IMetadataContext<Serializable,Component>, IQueueRegion, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class TimeField extends DateTimeField
Works on a Date object. Displays a field for hours and a field for minutes, and an AM/PM field. The format (12h/24h) of the hours field depends on the time format of this TimeField's Locale, as does the visibility of the AM/PM field (see DateTimeField.use12HourFormat()).
Author:
eelcohillenius
See Also:
  • Constructor Details

    • TimeField

      public TimeField(String id)
      Construct.
      Parameters:
      id - the component id
    • TimeField

      public TimeField(String id, IModel<Date> model)
      Construct.
      Parameters:
      id - the component id
      model - the component's model
  • Method Details

    • convertInput

      public void convertInput()
      Description copied from class: DateTimeField
      Sets the converted input, which is an instance of Date, possibly null. It combines the inputs of the nested date, hours, minutes and am/pm fields and constructs a date from it.

      Note that overriding this method is a better option than overriding FormComponent.updateModel() like the first versions of this class did. The reason for that is that this method can be used by form validators without having to depend on the actual model being updated, and this method is called by the default implementation of FormComponent.updateModel() anyway (so we don't have to override that anymore).

      Overrides:
      convertInput in class DateTimeField