beautypg.com

Bindings in the query part, Bindings in the repetition part – Apple WebObjects 3.5 User Manual

Page 82

background image

Chapter 3

Creating a WebObjects Database Application

82

Bindings in the Query Part

In the query part of the component,

movieDisplayGroup.queryMatch.title

is bound to the

Title text field. There are similar bindings to the Category and Rating text
fields. The

queryMatch

bindings allow users to specify search criteria to use when

movieDisplayGroup

next fetches movies. The Match button is bound to

movieDisplayGroup.qualifyDataSource

, which actually performs the fetch.

For example, to display only R-rated comedies, a user types “Comedy” in the
Category text field, types “R” in the Rating text field, and clicks the Match
button.

movieDisplayGroup

then refetches, selecting only movies whose

category

values are set to Comedy and whose

rating

values are set to R.

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.

Displays the binding for the
repetition’s

list

attribute.

Displays the binding for the
repetition’s

item

attribute.

Displays the binding for the
string’s

value

attribute.