Example application
The simple DVD rental application that we are building needs programming in two places:
To register a rental (create new record)
To register a return (update an attribute value)
Registering a rental
You probably remember from Chapter 3, Creating Task Flows and Pages, that registering a new rental is simply a matter of registering two data values when the store clerk presses a button. The screen is shown in the following screenshot:
In this simple demo application, we are assuming that the clerk will read a customer ID from a membership card and an inventory ID from the cover of the DVD –– in a more user-friendly application, you could of course expand on this. But for now, we just need to insert a new record into the Rental
table when the user has entered two values and pressed the button.
Creating a bean
Start by opening the RentDvd page fragment and double-clicking on the Register rental button. This brings up the Bind Action Property dialog where you can click on New to create...