Answers

Question and Answer:

  Home  EXT GWT

⟩ Explain Code of entry point with onModuleLoad where split out is working?

To split your code, simply insert calls to the method GWT.runAsync at the places where you want the program to be able to pause for downloading more code. These locations are called split points. For this you should use runAsync.

public class Hello implements EntryPoint {

public void onModuleLoad() {

Button b = new Button("Click me", new ClickHandler() {

public void onClick(ClickEvent event) {

GWT.runAsync(new RunAsyncCallback() {

public void onFailure(Throwable caught) {

Window.alert("Code download failed");

}

public void onSuccess() {

Window.alert("Hello, AJAX");

}

});

}

});

RootPanel.get().add(b);

}

}

 179 views

More Questions for you: