You can insert, update, and delete movies with this page the same way you do in Main. Not surprisingly, the steps for creating the search page are very similar to those for creating Main.
When you created the Main page, you created a new model file with the Database Wizard. The wizard saved the model in the Movies application directory. When you run the Database Wizard this time, you can specify that model file.
A model file is actually a directory, or file package, that contains a collection of files that shouldn't be separated. A model's file package has the extension .eomodeld (for eomodel directory).
For Mach Users Only: WebObjects application directories such as Movies.woa are also file packages. Ordinarily you can't see the contents of a .woa directory in the Workspace File Viewer, in Open panels, or in Save panels. To select the model file in the Database Wizard's open panel, bring the Workspace File Viewer to the front. Navigate to your Movies.woa application directory, and choose File Open as Folder. The Workspace opens a new viewer window that's focused on the contents of the Movie.woa directory. Select the model file package, and drag it into the Database Wizard's Open panel.
Model files store database login and primary key information, so when you run the Database Wizard this time, it doesn't prompt you with a Choose Adaptor panel, a login panel, or a Choose a Primary Key panel.
As you can see in the Choose a layout panel's page preview, the Matching Records option generates a database search form in which users can specify record-matching criteria.
When you choose the Matching Records layout option, you must tell the Database Wizard what attributes to put in the query form.
As before, the Database Wizard designs a functional page, but this one allows you to search the database for a movie that matches criteria you specify. It again uses a WODisplayGroup to not only fetch objects from the database, but also to build the query.
When Fetches on load is selected, the display group fetches records from the database when the component is loaded into the application. You want this feature in the Main page so that your users are immediately presented with a list of movies when they start the application. In contrast, the MovieSearch page should not present a list of movies until the user has entered search criteria and clicked Match. Thus, you deselect Fetches on load so that the movie list is not displayed until the query is performed.
Entries per batch specifies the number of records the display group displays at a time. When this number is 0, as it is in the MovieSearch page, the display group won't display search results in batches. Instead, all the movies that match a user's search criteria are displayed at once. In Main, the batch size is 10 and you use the Next Page and Previous Page buttons to page through the results. The Database Wizard set the batch size to 10 for the Main page because you specified the Paginated 10 per page option when you created it. The Database Wizard sets the batch size to 0 for all other page layout options.
The pagename binding is a mechanism for navigating to another page. By setting the attribute to "MovieSearch", you're telling the application to open the MovieSearch page when the hyperlink is clicked.
A user should also be able to get back to the Main page from the MovieSearch page.
How does the qualification mode affect searching in the Movies application?
Table of Contents Next Section