load Method Explained |
Before the form is displayed
- A borrower object is created
- The form caption is set
- The borrower's collection of checked out books is associated with the list box
Instructions
- In the Class Browser, select the RandomBorrowerForm.
- In the properties window, select <form>.
- In the methods window, select load.
- Copy and compile the code on the right.
|

load() updating;
begin
beginTransaction;
create borrower;
commitTransaction;
caption := "Books for " & myBorrower.String;
listBoxBooks.listCollection(myBorrower.myBooks, true, 0);
end; |
|
displayEntry Method Explained |
In the load method you specified the collection to be used for the list box.
Now you must specify the text to be displayed for each object in the collection.
Instructions
- In the Class Browser, select the RandomBorrowerForm.
- In the properties window, select listBoxBooks.
- In the methods window, select displayEntry.
- Copy and compile the code on the right.
|

listBoxBooks_displayEntry(listbox: ListBox input; obj: Any;
lstIndex: Integer):String updating;
begin
return obj.Book.title;
end; |
|
unload Method Explained |
Before the form is unloaded
- The borrower object is deleted.
- The checked out books no longer reference the borrower (JADE automatic maintenance).
In effect the books are checked in.
Instructions
- In the Class Browser, select the RandomBorrowerForm.
- In the properties window, select <form>.
- In the methods window, select unload.
- Copy and compile the code on the right.
|

unload() updating;
begin
beginTransaction;
delete borrower;
commitTransaction;
end; |
|