Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Getting Started With WebObjects


   

Adding a Talent Display Group

The browser you just created is going to display a list of Talent objects. Like a repetition element, a browser has list and item attributes. As the browser moves through its list, the browser sets item to the object at the current index. The Movies application uses a display group to provide the browser with a list of Talent objects, so now you need to create the new display group and a variable to bind to the browser's item attribute.

  1. Use the Add Key command to create two new instance variables:

  2. talentDisplayGroup, whose type is WODisplayGroup

  3. talent, whose type is Talent

    You don't need to add set and get methods for the variables.

  4. Using the Display Group Options panel, assign the talentDisplayGroup object's entity to Talent.

    Remember that to open the Display Group Options panel, simply
    double-click the talentDisplayGroup variable in the object browser. The icon initially displayed next to the variable indicates that initialization parameters have not yet been set.

  5. Configure talentDisplayGroup to sort its objects alphabetically (ascending) by lastName.

  6. Configure it to fetch on load and click OK.

    After you configure talentDisplayGroup, the object browser shows a icon next to the variable.

The Movies application uses a display group to provide Talent objects, but you could fetch the Talent objects from the database without one. Display groups provide a simple way to fetch, insert, update, and delete enterprise objects without writing much, if any, code. To get finer-grained control over these operations, you can work directly with an EOEditingContext object. An editing context can do everything a display group does and much more, but you have to write more code to use one. For more information, see the EOEditingContext class specification in the Enterprise Objects Framework Reference.


© 1999 Apple Computer, Inc. – (Last Updated 24 Aug 99)