Is this correct?
So, if a class like AView is instantiated using UIBinder when doing a
createAndBind on an xml file that has a reference to AView, and Aview
has an @Singleton annotation, you can have a constructor in some
presenter class APresenter like
@Inject
public APresenter(AView aView) {...
and GIN this will not result in 2 AView objects?
Also, could you use
@Inject
public APresenter(Provider<AView> aView) {...
What would be the difference (except for calling aView.get()) in these
2 ways of handling things?
Thanks.
On Jul 19, 9:34 am, Eric <[email protected]> wrote:
> On Jul 18, 10:48 am, Thomas Broyer <[email protected]> wrote:
>
> > GIN and UiBinder don't know of each other. If you want your instances
> > injected by GIN, then you should provide them to UiBinder so it
> > doesn't instantiate them by itself. This is generally done using
> > @UiField(provided=true), and initializing the field (view GIN)
> > *before* calling createAndBindUi.
>
> One example in my code was that I needed to create
> a SuggestBox with a custom SuggestOracle. The oracle
> can be set only in the box's constructor, and so I injected
> the oracle into the class and used @UiField(provided=true)
> to allow my version to be used.
>
> Eric
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.