// Create a SearchWidget, based upon a map's model:
final FeatureSearch searchWidget = new FeatureSearch(mapModel, true);
// What to do when the result of a search comes in?
// The DefaultSearchHandler will add all the features in the result to the given FeatureListGrid.
searchWidget.addSearchHandler(new DefaultSearchHandler(featureListGrid) {
// After the features have been added to the FeatureListGrid, make sure the tab with the grid is visible:
public void afterSearch() {
showPanel(gridPanel);
}