ron
09/18/2016, 6:24 PMScreenshot at 2016-09-18 20-23-35.png▾
edvin
09/18/2016, 6:25 PMron
09/18/2016, 6:25 PMedvin
09/18/2016, 6:27 PMron
09/18/2016, 6:27 PMedvin
09/18/2016, 6:29 PMmodel.updateEntry()
ron
09/18/2016, 6:30 PMedvin
09/18/2016, 6:33 PMonCommit
function to do that. Simply rename updateEntry
to onCommit
and add override modifier, then you can just call model.commit()ron
09/18/2016, 6:34 PMron
09/18/2016, 6:36 PMedvin
09/18/2016, 6:36 PMedvin
09/18/2016, 6:36 PMedvin
09/18/2016, 6:40 PMedvin
09/18/2016, 6:57 PMfx:controller
attribute support causes side effects with @FXML
annotated properties. I might need to revert it.edvin
09/18/2016, 7:03 PMhasControllerAttribute
parameter now.carlw
09/18/2016, 11:14 PMkotlin_javafx_annotated.png▾
edvin
09/19/2016, 5:47 AMView
or a Fragment
as the controller by dictating it in the FXML file. If you think about it, the whole point of the fxml
delegate is to load an FXML file and become the controller for that FXML file. Consider this example:edvin
09/19/2016, 5:48 AMMyView.FXML
file is loaded, and this instance of MyView becomes the controller for that FXML file. If you want to specify com.mypackage.MyView
in the FXML file so you can enjoy code completion and help when you use scene builder, you are welcome to set fx:controller="com.mypackage.MyView"
in there, but then you need to change the fxml delegate to:edvin
09/19/2016, 5:49 AMoverride val root: BorderPane by fxml(hasControllerAttribute = true)
(or simply true)edvin
09/19/2016, 5:50 AMFXMLLoader
to just arbitrarily instantiate a new View and set that as it's controller, because then the button
would not be injected correctly, and any action would not be called on the instance of the View that you already have instantiated.edvin
09/19/2016, 5:51 AMedvin
09/19/2016, 5:57 AMedvin
09/19/2016, 6:07 AMloadFXML
that returns both the node and the controller in one swoop:edvin
09/19/2016, 6:07 AMedvin
09/19/2016, 6:07 AMron
09/19/2016, 6:18 AM