@FlowScoped
public class DataModel {
private int counter = 0;
private ObjectProperty<SimpleValue> simpleValue = new SimpleObjectProperty<SimpleValue>();
public DataModel() {
counter++;
print("ctor");
}
public void print(String from) {
System.out.println(from + ": counter = " + counter + " simple value: " + getSimpleValue());
}
public final ObjectProperty<SimpleValue> simpleValueProperty() {
return this.simpleValue;
}
public final de.zwieblum.dataFx.SimpleValue getSimpleValue() {
return this.simpleValueProperty().get();
}
public final void setSimpleValue(
final de.zwieblum.dataFx.SimpleValue simpleValue) {
System.out.println("set value:" + simpleValue);
this.simpleValueProperty().set(simpleValue);
}@FXMLController("wizardView1.fxml")
public class WizardView1Controller {
@Inject
private DataModel model;
@FXMLViewFlowContext
ViewFlowContext context;
@PostConstruct
public void init() {
model.setSimpleValue(new SimpleValue("simple value - from wizard #1")); // this should have value, right??
this.model.print("wizard #1");
}
}
ctor: counter = 1 simple value: null
ctor: counter = 1 simple value: null
WizardController: counter = 1 simple value: null // and it is null!
ctor: counter = 1 simple value: null
ctor: counter = 1 simple value: null
set value:SimpleValue [name=simple value - from wizard #1] //value is not null
wizard #1: counter = 1 simple value: null //why null?