For some inexplicable reason for me ,Gin does not works as i intend. Let me explain with little code.
Let say i have a formA
@Singleton
public class formA extends Composite
private final MyGinjector ginjector;
@Inject
public formA(MyGinjector ginjector)
{
this.ginjector = ginjector;
this.add(ginjector.getFormB());
this.add(ginjector.getFormC());
}
here are and formB and formC (let assume formB and formC has similar code)
@Singleton
public class formB extends Composite
{
@Inject
public formB(MyGinjector ginjector)
{
this.ginjector = ginjector;
..............
}
}
And the problem i has been facing is in some moment when i inject formA (ginjector.getFormA() return an instance of formA but with missing childWidgets meaning with no reference to formB and formC
What could be the problem? all forms are singleton ... probably i should not inject the ginjector like that?
Thanks