Monday, November 1, 2010

Re: Injecting EventBus with GIN

xworker,

I think you want to inject type EventBus rather than SimpleEventBus in your I18NLabel constructor. But just to be clear, which class is reporting the no zero-args constructor err?

On Mon, Nov 1, 2010 at 10:31 AM, xworker <blomqvist.andreas@gmail.com> wrote:
Hi all

Trying to inject the eventbus into a component but I'm getting the
"has no default (zero args) constructor." error. Any clues what I'm
doing wrong? Very new to GIN, so it might be trivial..

Here is my code:

module:
public class MyWidgetClientModule extends AbstractGinModule {
         protected void configure() {
                 bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);

         }
       }

injector:
@GinModules(MyWidgetClientModule.class)
public interface MyWidgetGinjector extends Ginjector {

}

and the component I trying to inject:
public class I18NLabel extends Label implements
ChangeLanguageEventHandler{


       private final SimpleEventBus eventBus;
       private String key;

       @Inject
       public I18NLabel(SimpleEventBus eventBus) {
               this.eventBus = eventBus;
       }
...
...

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment