Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-688

DatePicker doesn't work with TextField

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0-beta1
    • 1.3.0-beta2
    • wicket
    • None

    Description

      DatePicker doesn't work with a TextField even though whose type has been set to java.util.Date. This is because when it tries to get a converter for DateTime.class, a DefaultConverter is returned instead of null. So it won't try to get a converter for Date.class:

      protected void checkComponentProvidesDateFormat(Component component)
      {

      if (component instanceof ITextFormatProvider)

      { // were ok return; }

      IConverter converter = component.getConverter(DateTime.class);
      if (converter == null)

      { converter = component.getConverter(Date.class); }

      if (converter instanceof DateConverter)

      { return; // This is ok }

      throw new WicketRuntimeException(
      "this behavior can only be added to components that either implement "
      + ITextFormatProvider.class.getName() + " or that use "
      + DateConverter.class.getName() + " configured with an instance of "
      + SimpleDateFormat.class.getName()
      + " (like Wicket's default configuration has)");
      }

      Attachments

        Activity

          People

            ehillenius Eelco Hillenius
            freemant Kent Tong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: