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

DatePicker setConverter method does not take effect without setting value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
    • Environment:

      Java8 build 106, b124, b129
      Tested on Windows 7 and windows 8.1
      E(fx)clipse kepler IDE

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: