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


   

Managing a WODisplayGroup's Selection

Remember how clicking a movie title in the Main page selects the corresponding Movie object in movieDisplayGroup. MovieDetails has a similar behavior for selecting a MovieRole object in movieRoleDisplayGroup.

First you need to add a hyperlink element around the repetition's role name string so that users can select a particular MovieRole. When a user clicks one of the movie role hyperlinks, the application should select the corresponding MovieRole object in the movieRoleDisplayGroup.

  1. Select the repetition's role name string element.

  2. Click the Add WOHyperlink button in the toolbar to add a hyperlink element around the string.

    Now you need to create an action method to invoke when the hyperlink is clicked.

  3. Use the Add Action command in the pull-down list to add an action named selectObject, returning null.

  4. Bind the selectObject method to the hyperlink's action attribute.

  5. Now write the code for selectObject in MovieDetail.java. Modify the selectObject action to look like the following:

    public WOComponent selectObject() {
       movieRoleDisplayGroup.selectObject(movieRole);
       return null;
    }


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