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

@FXML fields not injected when controller is proxied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 8u20, 8u40
    • javafx

      When trying to use the CDI specification within a JavaFX application, fields and methods annotated with @FXML are not being injected correctly. The controller class is proxied by Weld (Reference Implementation of CDI). CDI part works fine (@Inject, etc), controller object is instantiated, managed, and returned to FXMLLoader by a custom Callback Controller Factory. Mapped methods directly in the .fxml are accessible and click works.

      Problem is with any @FXML annotated method and field.

      1) Run application
      2) Click button
      3) See NPE on console

      Sample project on GitHub: https://github.com/brunoborges/weld-cdi-javafx-bug

            msladecek Martin Sládeček
            bborges Bruno Borges (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: