Monday, May 13, 2013

Re: vanilla-gwt with errai

I added Errai's EventBus to a vanilla GWT app (push notification) without using Errai's IOC library ( I am using RequestFactory and GIN/GUICE) and it worked fine.

Here is the Gin configuration:

@Provides  @Singleton   public RequestDispatcher getRequestDispatcher() {      return ErraiBus.getDispatcher();   }     @Provides   @Singleton    public MessageBus getMessageBus() {      return ErraiBus.get();  }

On the client side inject MessageBus and RequestDispatcher into your class and then you can do following things:

Subscribing:

messageBus.subscribe("BroadcastReceiver", new MessageCallback() {      @Override      public void callback(Message message) {           //DO SOMETHNG      }  });

Sending message:

MessageBuilder.createMessage("ClientComService")                  .noErrorHandling()                  .sendNowWith(dispatcher);

On the server side am using Spring.

On Saturday, May 11, 2013 11:18:39 PM UTC+2, kim young ill wrote:

hi there, anyone out there has any experience using vanilla gwt with errai ? there're some cool things from errai (event-bus, server-push) i want to use, but i dont want to rewrite the existing-app to use errai, especially gin/guice (i'm using mainly request-factory with guice/gin, place/activities & editor). i look thru the docs of errai & it looks like you're tied to the container injection framework of errai.

thanx

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

No comments:

Post a Comment