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

Getting the Controller Instance after Including an FXML to another

    XMLWordPrintable

    Details

    • Subcomponent:

      Description

      Following Scenario:

      I define 2 FXML + Controllers:

      A.fxml
      A.java

      B.fxml
      B.java

      Now I use fx:include to import B into A. Now I embed B into the hierarchy graph of A.fxml.
      In A.java I use @FXML to get the reference to the Node which is represented by the included B.fxml. Works like a charm.

      My Problem is now:

      Inside of A.java I do need a reference to the instance of the controller (B.java) which belongs to the @FXML-injected node of the B.fxml. How to achieve this?

        Attachments

          Activity

            People

            Assignee:
            ekrejcir Eva Krejčířová (Inactive)
            Reporter:
            acasalljfx Alexander Casall (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: