I have a new project in which I use GWT-Views like Composite etc.
I entered the items in the main menu (for example, ProductList
below) using GinInjector. It works great!
Somewhere I want to have a link from a small component to an item from my main menu in order to update it. I am trying to do it like this:
public class ProductForm extends Composite {
...
@Inject
ProductList list;
....
}
But when I use list
, I always get null
. Thus, it ProductList
is defined as follows:
public class MyModule extends AbstractGinModule {
...
@Override
protected void configure() {
bind(ProductList.class).asEagerSingleton();
bind(ProductForm.class).asEagerSingleton();
}
...
}
Any idea what I'm doing wrong ?!
Solution : I did not mention that ProductForm is a ProductList element using the UIBinder @UIField tag, so a new object will be created for its injection, not the one created using UIBinder.
, , ( @UIField).