Previous | Next
WireHose Developers Guide

Removing the search box from a specific page

The WHSearchResultsPage component includes a search box by default.

This interferes with Hello World's user interface because a search box is already included within the wrapper. In this step you'll remove the search box through another entry in the layout dictionary.

  1. Find this entry in the layout dictionary:
    WHSearchResultsPage = {
        pageName = WHSearchResultsPage;
        showSearchBox = YES;
    }; 

    Change it so it reads:

    WHSearchResultsPage = {
        pageName = WHSearchResultsPage;
        showSearchBox = NO; 
    };
  2. Reload the page in your browser.

How this works: Just like WHSearchBox, the WHSearchResultsPage includes a WOConditional to determine whether to include a search box. The conditional's condition is bound to showSearchBox. Just like WHSearchBox.java, WHSearchResultsPage.java defines this method:

public boolean showSearchBox() {
    return booleanForBinding("showSearchBox");
}

However, since page-level components are never embedded in another component, you can't set any bindings directly. Resolving page-level bindings through the layout dictionary lets you customize page components without writing any code.


Previous | Next