This configuration poses two problems.
The first is not such a huge one, I guess and I only mention it as a kind of a sidenote. I need to create a subflow that will take the data model from the main flow and use it. I don't want the specific flow to clutter my main flow, so I guess in the future I will create a simple placeholder view (containing only a stackpane) that I will include in the main flow, which will then create a flow of its own, the subflow I need. I think this will work quite well, but haven't tried it -- if you think it won't please let me know.
The second one is quite a big one and it's of a more pressing nature: I need to have a link between views with some advanced validation. Right now I handle it his way:
(MainWindowController.java)
final Flow innerFlow = new Flow(ClientViewController.class)
.withAction(Subflow1ViewController.class, "save", new FlowActionChain(
new FlowMethodAction("saveIt"), new FlowLink<>(Subflow2ViewController.class)));
(Then Subflow1ViewController.java)
public void saveIt() throws VetoException {
subflowModel.setProduct(model.selectedProductProperty().get());
subflowModel.addLines(JavaFX.getText(textArea)); // JavaFX.getText() simply splits textarea.getText() on newline
if(scanModel.getLines().size() < 1) {
new Alert(Alert.AlertType.ERROR, "The data is incorrect.", ButtonType.CLOSE).showAndWait();
throw new VetoException(new Veto());
}