Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

GWT%20Interview%20Questions%20and%20Answers

Question: Code of entry point with onModuleLoad where split out is working.
Answer: 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);
}
}
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook