-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Injection of root element #236
Comments
Given the following example files:
where When I understand you correctly you want to inject the root Node of |
Would the fx:root mechanism fit to your requirements? With this approach you extend the view from a node. In this case the View is automatically the root container and contains the children. https://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm |
@lestard yes exaxctly :-) |
The oracle documentation is misleading. You can use this approach to implement custom components not custom controls (control api). I recommend to have a short look on this approach. |
The fx:root mechanism works for the fxml that is loaded directly via FluentFXMLLoader but not for included FXML. |
Maybe this can be implemented with Java 9 LoadListener |
Hi, would it be possible to inject the root element of a view into the code behind (view) via a special annotation or something?
At the moment I need to know the fx:id of the element I want to inject into the view. But often the root element has no fx:id and I don't want to give it a common fx:id (or I can't force the creator of the fxml to do so ;-)).
I think of something like:
The injected Node should be the root node of the fxml. When the fxml is included in another fxml it should still be the root node of this fxml and not of the whole scene graph.
The text was updated successfully, but these errors were encountered: