Sorry if this duplicates another question, but I didn't find it.
Tab order seems to be a function of declaration sequence within the .fxml file, so I guess you can hack around in the raw XML to change it when needed. But figuring out what determines which Node gets focus when a Form is loaded & shown escapes me. The Oracle docs say:
One thing that appears to be true is that a TextField gets precedence over a Button, i.e. if you have one of each on a Layout the TextField will always have focus when the Form is loaded and shown.
This is probably more of a JavaFX issue than a B4J issue but they are hard to separate when you are using B4J. But to sum up, my question is:
Does anybody know where to find comprehensive rules regarding focus and how to manage it at design time?
Tab order seems to be a function of declaration sequence within the .fxml file, so I guess you can hack around in the raw XML to change it when needed. But figuring out what determines which Node gets focus when a Form is loaded & shown escapes me. The Oracle docs say:
So it seems to be "random" (even though consistent once a Form and View have been created), though the rules appear to vary from Form to Form. You almost have to add a requestFocus() call to every chunk of Form-initialization code in your programs.When a Scene is created, the system gives focus to a Node whose focusTraversable variable is true and that is eligible to receive the focus, unless the focus had been set explicitly via a call to requestFocus().
One thing that appears to be true is that a TextField gets precedence over a Button, i.e. if you have one of each on a Layout the TextField will always have focus when the Form is loaded and shown.
This is probably more of a JavaFX issue than a B4J issue but they are hard to separate when you are using B4J. But to sum up, my question is:
Does anybody know where to find comprehensive rules regarding focus and how to manage it at design time?