This discussion is archived
2 Replies Latest reply: Nov 5, 2012 4:19 PM by 858139 RSS

How to pass data to popup dialog

858139 Newbie
Currently Being Moderated
Hi All,

How do I pass some data from the main window to the popup dialog. Please help.

Thanks in advance.
  • 1. Re: How to pass data to popup dialog
    972422 Newbie
    Currently Being Moderated
    I think you can create a Group with a scene that contain the value from the main window then use the getContent.add() method of Popup.

    Group root = new Group();
    Scene scene = new Scene(root,200,200);
    //add the value form main windown to scene
    ......

    Popup pop = new Popup();
    pop.getContent().add(root);

    Glad if this can help you
  • 2. Re: How to pass data to popup dialog
    858139 Newbie
    Currently Being Moderated
    Thanks for your response.

    I found out that we can use setUserData() and getUserData() in Node class to pass data between windows. The only problem I have is I'm using FXML for popup dialog so the Scene of my popup in the initialize funtion is always null.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points