20.7. Implementation and Testing

Since searching is related to posts, you will add the views that you created to the PostView component.

Edit the VBox that currently contains the PostList that displays the recent posts, adding the SearchBoxView and CategorySearchView, as in the following:

<mx:VBox width="25%">
      <mx:Label styleName="viewSubheder" text="Recent Posts"/>
      <views:PostList dataProvider="{this.model.recentPosts}" width="100%"/>
      <views:SearchBoxView width="100%"/>
      <views:CategorySearchView width="100%"/>
</mx:VBox>

Now edit the VBox that currently contains the PostDisplay and CommentView, adding the SearchResultsView, as in the following:

<mx:VBox width="100%">
      <views:SearchResultsView width="100%"/>
      <views:PostDisplay width="100%"/>
      <views:CommentView width="100%"/>
    </mx:VBox>

If you debug the application, it should look like (Figure 20-1).

Figure 20.1. Figure 20-1

First do a keyword search that will not bring up any results. Search for "0000" (those are zeros not the letter o). You should see a notification, like the one at upper left in (Figure 20-2).

Figure 20.2. Figure 20-2

Clear the notification and search for something that will bring up a result, such as "china" in the results window at left. Your screen should now look like (Figure 20-3).

Figure 20.3. Figure ...

Get Professional Cairngorm™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.