Questions tagged [gwt-gin]

GIN brings automatic dependency injection to GWT client-side code.

GIN (GWT INjection) brings automatic dependency injection to Google Web Toolkit client-side code. GIN is built on top of Guice and uses (a subset of) Guice's binding language.

195 questions
1
vote
1 answer

Calculated constants in Google Guice

I want to be able to achieve the following using guice/gin: Get all sort of constants from the server (user settings, language, etc) Bind those constants to "Named(###)" in a guice/gin module inject those to constructors in my code, that are called…
Shuky Capon
  • 785
  • 5
  • 22
1
vote
2 answers

Error binding view to presenter?

I'm getting this error when running GWT application: java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement() public class MainView extends Composite…
quarks
  • 33,478
  • 73
  • 290
  • 513
0
votes
1 answer

Customise the creation of a gin managed object or creating two different instances of the same class

I want to be able to create two instances of the same class and have them be injected with different properties and then have those two objects injected into two specific locations in my application. Currently I have a method in my ClientModule... …
Michael Wiles
  • 20,902
  • 18
  • 71
  • 101
0
votes
1 answer

What does the Google GIN method : bind(Class class)

I've read some documentation and downloaded samples but I still got a question. In most sample, the GIN module uses something like : bind(MainActivityMapper.class); bind(VerticalMasterActivityMapper.class); I don't understand what it does? If I…
Michael Laffargue
  • 10,116
  • 6
  • 42
  • 76
0
votes
1 answer

Inject views into other views with Gin

I am using an MVP architecture (or at least an approximation of one) and have a hierarchy of presenters, with similarly nested views. I'll stick to the first 2 levels for simplicity: AppPresenter/AppView at the top level.…
David Mason
  • 2,917
  • 4
  • 30
  • 45
0
votes
1 answer

bind constant by program/class with gwt/gin

How can the constant be bound by program/class with gwt/gin? Instead of: bindConstant().annotatedWith(AString.class).to("XYZ"); We need: ( Obviously, it doesn't compile…
Tom Fishman
  • 1,716
  • 6
  • 22
  • 36
0
votes
1 answer

Dynamically add Binds to a GIN Module

Can I add binds to a GIN module dynamically? For example, having a module "ExampleModule," and calling a static method on it, eg: bind (Test.class, TestImpl.class); and GIN do the bind automatically? Or maybe using annotations? Thanks in advance.
caarlos0
  • 20,020
  • 27
  • 85
  • 160
0
votes
3 answers

GWT-Platform: where the business logic should go?

I just got the grip on GWTP and the MVP, GIN and Dispatch. With dispatch there is a Handler class which defines what the action does and returns something accordingly. So far I found myself with a case where I have 2 actions that require to execute…
javaNoober
  • 1,338
  • 2
  • 17
  • 43
0
votes
1 answer

GWT/Gin creating class with @Inject annotation in constructor

Let's say I have a class public class Foo{ @Inject public Foo(MessageBus messageBus, SomeServiceAsync service){ ... } ... I have some doubt on how I would construct such a class, given that the constructor parameters are to be…
Tony BenBrahim
  • 7,040
  • 2
  • 36
  • 49
0
votes
1 answer

GWT Generator not called with GIN Injection

I have declared a generator in my GWT module descriptor and it seems it is not called when the class which trigger the generator is instanciated via the Ginjector. public interface MyGinjector extends Ginjector { MyWidget getMyWidget(); } public…
Oziris
  • 1
0
votes
2 answers

Gin problem when having java.util.List in the client code

I met very weird problem, using Gin injector in the client code return error with the following stack trace: ERROR: Deferred binding result type 'java.util.List' should not be abstract. ERROR: Uncaught exception escaped. java.lang.RuntimeException:…
brakebg
  • 414
  • 3
  • 11
  • 24
0
votes
1 answer

Gin weird behavior in a Gwt project

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…
brakebg
  • 414
  • 3
  • 11
  • 24
0
votes
1 answer

Inject into anonymous inner class (GIN)

I have something like this: request.findAllProjects().fire(new ExtReceiver>() { @Override public void onSuccess(List response) { view.setProjects(response); } }); It is…
ludwigm
  • 3,363
  • 3
  • 28
  • 36
0
votes
1 answer

How to destroy singleton when activity is reset?

I use gwt 2.8 anf google-gin 2.12 I would like to inject some object into a deep custom com.google.gwt.user.client.ui.composite. For instance this composite may contain a panel which contains other UIBinded views which can contains other nested…
Fractaliste
  • 5,777
  • 11
  • 42
  • 86
0
votes
3 answers

Why get 403 forbidden when get API data?

Using react-admin at front-end to access gin developed API back-end. Front-end: http://localhost:3000 Back-end: http://localhost:8080 When access URL from Chrome browser: http://localhost:3000/#/posts Got this message from Chrome…
v v
  • 613
  • 3
  • 10
  • 26