Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094452

DatePicker setConverter method does not take effect without setting value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u20
    • 8
    • javafx
    • Java8 build 106, b124, b129
      Tested on Windows 7 and windows 8.1
      E(fx)clipse kepler IDE

      When a seTConverter method of DatePicker is set, the changes do not take effect and the new converter does not kick in, until a different value is set for DatePicker. I have tried this in different versions of java8 from build 106 to b129 and in all of them I get the same issue.

      fromDP.setConverter(myConverter);


      My work around has been to change the LocalDate value and then set it back to the correct date to make the runtime apply my converter:


      fromDP.setConverter(myConverter);
      LocalDate ld = fromDP.getValue();
      fromDP.setValue(ld.plusDays(1));
      fromDP.setValue(ld);

      The reason I noticed this is because I am creating a screen to change the string presentation of the DatePicker based on some radio button selection by the user and I expect the new StringConverter to take effect as soon as it's set.

            leifs Leif Samuelsson (Inactive)
            hadijfx Hadi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: