Configuring a Repetition
Now configure MovieDetails' repetition in a way similar to the way Main's repetition is configured. First you need to create a new variable to bind to the repetition's item attribute.
- Use the Add Variable/Method command to add a new variable, movieRole, whose type is set to the MovieRole entity.
- Bind movieRoleDisplayGroup.displayedObjects to the repetition's list attribute.
- Bind movieRole to the repetition's item attribute.
- Bind movieRole.talent.firstName to the value attribute of the first string in the repetition.
- Bind movieRole.talent.lastName to the value attribute of the second string.
- Bind movieRole.roleName to the value attribute of the last string.
Don't create set and get methods for movieRole. You won't need accessor methods because the variable is used only within the MovieDetails component and shouldn't be visible to any other classes.
Running Movies
Be sure that all your project's files are saved (including the components in WebObjects Builder and the model in EOModeler), and build and run your application. In the Main page, select a movie and click the Movie Details link. Now, in addition to displaying all the movie's information, the Movie Details page should also display the movie's roles and actors.
Table of Contents Next Section