Adding a Drop Down Filter

To demonstrate the use of filters we are going to create a filter for our movies Pod. The filter will select movies by genre. As we did in the last chapter we will insert the complete code sample first to see the Pod in action, then we will step through the code to see what we did to create the filter.

Appendix A.4 contains a program listing, replace the createPod method in the MyFavouriteMovies PodLoader with the version from the Appendix. Compile the PodLoader and launch the Application.

When the page loads the Pod will be updated to include a filter feature denoted by the pen icon on the title bar.

Open the filter by clicking on the pen icon. Select a genre from the drop-down. Use the Save button to save the selection and reload the list. The list will only return movies that match the selected genre in the dropdown.

Lets look at the steps we took to create the filter.