3

I am using GWTP (MVP framework by Google) with GWT 2.3. I want to use GWT code splitting with my presenters.

I know about @ProxyCodeSplit annotation in Presenters. Like below

@ProxyCodeSplit
@UseGatekeeper(LoggedInGatekeeper.class)
public interface MyProxy extends Proxy<MainPagePresenter> {
}

Is this sufficient ? Or Do I need to dig out GWT Code Splitting which provides A call to GWT.runAsync like Here

Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96

1 Answers1

5

No, GWTP will take care of calling GWT.runAsync for you, whenever the corresponding Presenter is shown.
However make sure that you use AsyncProvider in your Ginjector:

@GinModules({ MyModule.class })
public interface MyGinjector extends Ginjector {
  PlaceManager getPlaceManager();
  EventBus getEventBus();
  AsyncProvider<MainPagePresenter> getMainPagePresenter();
}
Ümit
  • 17,379
  • 7
  • 55
  • 74
  • 1
    Thanks Umit. I just wanted to confirm. We have already "AsyncProvider" in "Ginjector" and Presenters marked as "@ProxyCodeSplit". It is working..So, I am accepting your answer. – Hardik Mishra Jan 02 '12 at 05:34
  • For further confirmation you can also use **Firebug** or **Chrome Developer Tools** to check if a XHR request is created when you navigate to a Presenter which is marked with ``@ProxyCodeSplit`` – Ümit Jan 02 '12 at 13:07