Table of Contents Previous Section

Storing the Selected Movie

Now, in the MovieDetails component, create a variable that holds the application's selected movie. Later on, you'll add code to the Main.java class that assigns Main's selected movie to this variable.

  1. Choose Add Variable/Method from the pull-down menu.

  2. Name the variable selectedMovie.

  3. Set the variable's type to Movie.

    Movie isn't actually a class; it's an entity. It's listed in the combo box as a type along with entries for all the entities in your model. When you choose an entity as the type for your variable, WebObjects Builder recognizes that the variable is an enterprise object. Using information in the model, WebObjects Builder can determine the entity's corresponding enterprise object class and the properties of that class.

  4. Check the "An instance variable" box.

  5. Check the "A method returning the value" box.

  6. Check the "A method setting the value" box.

  7. Click Add.

Table of Contents Next Section