Bindings in the Repetition Part
In the repetition part of the component where matching movies are listed, movieDisplayGroup.displayedObjects is bound to a repetition. More specifically, displayedObjects is bound to the repetition's list attribute, providing a vector of movies for the repetition to iterate over.The movie variable is bound to the repetition's item attribute to hold each movie in turn, and movie.title is bound to the string element inside the repetition. These bindings produce a list of movie titles.
The repetition's string element is enclosed in a hyperlink. By clicking a movie title, the user selects the corresponding movie.
- Inspect the hyperlink.
- Look in the Main.java class to see how selectObject is implemented.
Its action attribute is bound to the action method selectObject.
The method (shown below) simply sets movieDisplayGroup's selected object to the movie the user clicked.
public void selectObject() { movieDisplayGroup.selectObject(movie); }
Table of Contents Next Section