Knute Snortum wrote:When you say "two levels deep", are you referring to the number of package folders or how deeply the call hierarchy is? It seems you are talking about packages. I not exactly sure what you mean by "pass an action event."
Kristina Hansen wrote:IDK about FX - but it shouldn't matter how deep you nest your GUI - the GUI event system in Java work by you register a listener to it wich gets called by the EDT
btw: it helps if you post a SSCCE
Knute Snortum wrote:Are you saying that this project structure works:
but this one doesn't?
Knute Snortum wrote:Looking over your project, something doesn't seem right with MainController. I don't think you can pull the sub-controllers in with an @FXML tag like that; you have to load them yourself. Also, to make MainController aware of the sub-controllers you need to set up a controller factory in the main view.
Look at this project on github:
In the class PassDataDemo, I load the controllers and set the panes (it would be tabs in your case). Then I set a controller factory to manage the panes.
See if this doesn't help you with your project.
AhFai Chan wrote:I am going to clone your demo from GitHub, hope you don't mind. Thank-you.
Also, reading through your intro, it seems I have been using MainController as the bridge to inject strings and properties into the other controllers. As said, it works for tree-1 but not tree-2.
AhFai Chan wrote:But I did download, unzip and modified your codes. I couldn't get it working.
I am going to read up on factoryController, and if you can point me to more detailed example, much appreciated.
Finally, why do we need a callback.
In another question I posted here, I have and an if-then-else based on value of textfield.getText() without a Callback?