
Setting Up a Master-Detail Configuration
109
1. In the MovieDetails component window, add the bolded text Starring:
beneath the Revenue line.
2. Below the Starring label, add a repetition.
3. Replace the “Repetition” text with three string elements.
The strings should all be on the same line, so don’t type carriage
returns between them.
4. Type a space between the first two strings and the word
“ as ” (with a
space before and after) between the last two.
5. Add a carriage return after the last string.
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.
1. Use the Add Variable/Method command to add a new variable,
movieRole,
whose type is set to the MovieRole entity.
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.
2. Bind
movieRoleDisplayGroup.displayedObjects to the repetition’s list attribute.
3. Bind
movieRole to the repetition’s item attribute.
4. Bind
movieRole.talent.firstName to the value attribute of the first string in the
repetition.
5. Bind
movieRole.talent.lastName to the value attribute of the second string.
6. Bind
movieRole.roleName to the value attribute of the last string.
Komentarze do niniejszej Instrukcji