{{theTime}}

Search This Blog

Total Pageviews

Adding a Google AJAX SearchControl to the page


Adding a Google AJAX SearchControl to the page

Let's create a basic but nicely formatted search box and the corresponding results using web and image results. Here we use the API's built in HTML rendering.
Replace the contents of your onModuleLoad method with the following:
public class Search implements EntryPoint {

  public void onModuleLoad() {

    SearchControlOptions soptions = new SearchControlOptions();
    WebSearch wSearch = new WebSearch();
    wSearch.setResultSetSize(ResultSetSize.LARGE);
    soptions.add(webSearch);
    ImageSearch iSearch = new ImageSearch();
    options.add(iSearch, ExpandMode.OPEN);
    final SearchControl scontrol = new SearchControl(soptions);
    scontrol.execute("treehouse");
    RootPanel.get().add(control);
  }
}

No comments:

java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport

SpringBoot Error: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.j...