Apple WebObjects 3.5 User Manual
Page 52

Chapter 2
Enhancing Your Application
52
10. In the object browser, click
application
.
There is an entry in the second column for the
allGuests
application variable
you created. This entry appears in the Main component as well, since
application variables are accessible from anywhere in the code.
If you click
allGuests
, you’ll see in the third column an entry for
count
. This is
a standard method that returns the number of objects in the array.
11. Click
count
and drag to the center rectangle to bind it to the WOString’s
value
attribute.
12. Save the GuestList component.
You need to do one more thing so that the GuestList page now displays
when the user submits the form.
13. Go back to Project Builder and view the source code for
Main.java
. Replace the
return
statement in the
submit
method with the following code:
return application().pageWithName("GuestList");
allGuests. count
represents the number
of objects in the array. Drag to bind it to the
WOString.