fix bugs with bindings

This commit is contained in:
Manfred Karrer 2014-08-30 00:54:59 +02:00
parent 29ad94c4d9
commit c8699dd66b
5 changed files with 61 additions and 26 deletions

View file

@ -43,10 +43,13 @@ public class CodeBehind<T extends PresentationModel> implements Initializable {
root.sceneProperty().addListener((ov, oldValue, newValue) -> {
// we got removed from the scene
// lets terminate
if (oldValue != null && newValue == null) terminate();
if (oldValue != null && newValue == null)
terminate();
});
presentationModel.initialized();
presentationModel.activate();
}
/**
@ -55,8 +58,10 @@ public class CodeBehind<T extends PresentationModel> implements Initializable {
*/
public void terminate() {
log.trace("Lifecycle: terminate " + this.getClass().getSimpleName());
if (childController != null) childController.terminate();
if (childController != null)
childController.terminate();
presentationModel.deactivate();
presentationModel.terminate();
}