First off, I am new to the world of JavaFX, so I might lack some basic knowledge, sorry about that. Also, this is the first time I ask a question, so I don't know how to formulate it.
What I want to do is quite basic: I have multiple pages which the user can switch between by pressing next/back. What is the best way to code this so the changes made by the user will be there when he returns to a page? I not only want the TextFields to have the same contents but also the attributes. Note: Every page has its own Controller which implements a common Interface.
I have already tried setting the pages via a loader and using the loader.setController()
method and handing over the Controller Object I got from loader.getController()
when first creating it, but that doesn't seem to have any effect.
Sorry if this is already answered somewhere, I couldn't find it.
Thanks in advance to anyone who takes his time to help me!
EDIT: The code with which I change the pages in the ControllerHolder Class
ResourceBundle bundle = FXMLUtil.getResourceBundle();
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource(
FXMLUtil.getFXMLPageByIndex(pageNumber)
));
loader.setResources(bundle);
initWizardHolder.getChildren().setAll(
(Node) loader.load());
currentController = loader.getController();