google-code-export / mvp4g

Automatically exported from code.google.com/p/mvp4g
1 stars 0 forks source link

Which EventBus class should Gin bind to? #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have my event bus interface like this:

@Events(startView=DashBoardWidget.class)
public interface MainEventBus extends EventBus {
....
}

Because this is an interface, I have to bind it to a concrete class in my 
GinModule config(). But which class should I use?

I am using 1.3.0 MVP4G, getting this error.

Deferred binding failed for 'com.google.gwt.event.shared.EventBus' (did you 
forget to inherit a required module?)

Thanks,
yan

Original issue reported on code.google.com by yanandyan@gmail.com on 26 Oct 2011 at 5:53

GoogleCodeExporter commented 9 years ago
Where do you try to inject this event bus?

Unfortunately, event bus can only be injected using mvp4g and presenter/event 
handler.

Original comment by plcoir...@gmail.com on 26 Oct 2011 at 6:50

GoogleCodeExporter commented 9 years ago
Hi,

I am not doing anything fancy, I am trying to build my first mvp4g GWT app.
I keep getting this: *Deferred binding failed for
'com.google.gwt.event.shared.EventBus' (did you forget to inherit a required
module?)*

the following is my presenter, view, entryPoint code. For some reason, it
always fail.

@Presenter(view=DashBoardWidget.class)
public class DashBoardPresenter extends
BasePresenter<DashBoardPresenter.Display, MainEventBus> {

public class DashBoardWidget extends Composite implements
DashBoardPresenter.Display {

@Events(startView=DashBoardWidget.class)
public interface MainEventBus extends EventBus {

    public void onModuleLoad() {
        Mvp4gModule module = (Mvp4gModule)GWT.create( Mvp4gModule.class );
        module.createAndStartModule();
        RootLayoutPanel.get().add( (Widget)module.getStartView() );
    }

<module rename-to='MainApp'>
    <source path="client"/>
    <source path="shared"/>
    <inherits name='com.google.gwt.user.User'/>
    <inherits name='com.google.gwt.user.theme.standard.Standard'/>
    <inherits name='net.customware.gwt.dispatch.Dispatch' />
    <inherits name="com.google.gwt.inject.Inject"/>
    <inherits name='com.mvp4g.Mvp4gModule'/>
    <entry-point class='com.medplus.certsuite.client.MainApp' />
</module>

Original comment by yanandyan@gmail.com on 26 Oct 2011 at 7:13

GoogleCodeExporter commented 9 years ago
I figured it out. I had some incorrect @inject in my presenter, it is trying
to bring in Google EventBus instances.

Original comment by yanandyan@gmail.com on 26 Oct 2011 at 8:16

GoogleCodeExporter commented 9 years ago
Great, I will then close this issue since it doesn't seem to be a mvp4g bug.

Original comment by plcoir...@gmail.com on 27 Oct 2011 at 12:54