I'm using FXML documents to define JavaFX layouts and have been using Java controllers but am now looking at javascript event handlers directly in the FXML documents.
I'm wondering if anyone knows how to call a Javascript function defined in a FXML document from the application?
ie given a FXML document F.FXML
<BorderPane>
<fx:script>
function something() {}
</fx:script>
</BorderPane>
thats loaded by FXMLLoader:
FXMLLoader fxml = new FXMLLoader("F.FXML");
BorderPane root = (BorderPane)fxml.load();
is it possible to do the equivalent of:
root.something()
I guess the work around is to do some magic with a controller class behind the scenes but i'd still like to define the functions in javascript.