Thursday, December 30, 2010

Re: Multiple Activity Mappers and Gin

Any progress on this? Did you mange to get it working?

On 11 Des, 17:14, sheamus <ohall...@gmail.com> wrote:
> Hi, I was able to getActivitiesworking with Gin using the post found
> herehttp://wanderingcanadian.posterous.com/hello-mvp-with-gin
>
> I was able to get this working with one ActivityManager and also got
> RequestFactory working using:
>
> @Provides
> @Singleton
> public FestivalRequestFactory getRequestFactory(EventBus eventBus) {
> final FestivalRequestFactory requestFactory =
> GWT.create(FestivalRequestFactory.class);
> requestFactory.initialize(eventBus);
> return requestFactory;
>
> }
>
> And now I'm trying to usemultipleActivityMapper(s) withmultiple
> ActivityManager(s), eg. each panel uses a different Mapper.
>
> I've tried this code:
>
> bind(ActivityMapper.class).to(WestActivityMapper.class).in(Singleton.class) ;
> bind(ActivityMapper.class).to(CenterActivityMapper.class).in(Singleton.clas s);
>
>         @Provides
>         @Singleton
>         public ActivityManager getActivityManager(ActivityMapper mapper,
> EventBus eventBus) {
>                 ActivityManager activityManager = new ActivityManager(mapper,
> eventBus);
>                 return activityManager;
>         }
>
> but because both bindings are to ActivityMapper it fails with:
>
> 16:01:35.569 [ERROR] [eventismo] Double-bound:
> Key[type=com.google.gwt.activity.shared.ActivityMapper,
> annotation=[none]].
> com.google.gwt.inject.rebind.binding.BindClassBinding@a77b84,com.google.gwt .inject.rebind.binding.BindClassBinding@19e51ea
>
> I've tried subclassing ActivityManager and using @Provides and
> returning the sub-class
> "public CenterActivityManager getCenterActivityManager()"  but this
> failed too..
>
> Any help appreciated, Thanks

--
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