beautypg.com

Refining main.wo, Refining main.wo 85 – Apple WebObjects 3.5 User Manual

Page 85

background image

Refining Main.wo

85

group’s selected object. These changes happen only in memory—not
in the database. To actually insert a new row in the database (or delete
a row), the user must click the “Save to database” button, invoking

saveChanges

on the session’s EditingContext. The editing context

analyzes the enterprise objects in memory; determines if any objects
have been added, updated, or deleted; and then executes database
operations to sync the database with the application.

Refining Main.wo

You may have noticed that your application doesn’t list fetched movies in
any particular order. Also, when you insert a new movie, it appears in the list
of movies as a blank line.

In this section you’ll tidy up the user interface to fix these things and a few
others. Specifically, you’ll:

Configure

movieDisplayGroup

to sort the movies it displays.

Assign default values to new Movie objects.

Change the way that dates and numbers are displayed.

You can also put the query part of the page in a table and capitalize

Main.wo

’s text field labels—for example, use “Title” instead of “title”

and “Date Released” instead of “dateReleased.”

A newly inserted movie doesn’t have
a title set, so it appears in the list
of movies as a blank line.