O'Reilly logo

Professional Cairngorm™ by Jeremy Wischusen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required