-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: 2.4.4.Final
-
Fix Version/s: 3.0.0.CR1
-
Component/s: ErraiDataBinding
-
Labels:None
-
Steps to Reproduce:
public class CarInfo { // some getters and setters } public class CarPresenter { private CarInfo car; public void setCar(CarInfo car) { this.car = car; } public CarInfo getCar() { return car; } }
CarPresenter is bindable (doesn't matter with @Bindable or through errai.ui.bindableTypes).
If CarInfo class is annotated with @Bindable, then generated code is correct, and looks like:
public CarPresenterProxy(CarPresenter target, InitialState initialState) { agent = new BindableProxyAgent<CarPresenter>(this, target, initialState); agent.propertyTypes.put("car", new PropertyType(CarInfo.class, true, false)); //... } public void setCar(CarInfo car) { if (agent.binders.containsKey("car")) { car = (CarInfo) agent.binders.get("car").setModel(car, InitialState.FROM_MODEL, true); } CarInfo oldValue = agent.target.getCar(); //... }
If CarInfo defined in errai.ui.bindableTypes, then generated code is invalid, and looks like:
public CarPresenterProxy(CarPresenter target, InitialState initialState) { agent = new BindableProxyAgent<CarPresenter>(this, target, initialState); agent.propertyTypes.put("car", new PropertyType(CarInfo.class, false, false)); //... } public void setCar(CarInfo car) { CarInfo oldValue = agent.target.getCar(); //... }