Binding elements, Creating variables, Binding elements 27 – Apple WebObjects 3.5 User Manual
Page 27: Creating variables 27

Binding Elements
27
5. Inspect the multi-line text area.
In Text Area Inspector, you can set various attributes corresponding to
those of a
element.
6. Increase the size of the element by specifying the number of columns
and number of rows to, say, 30 and 6.
7. Save the Main component.
Binding Elements
When a user enters information in GuestBook’s form elements, your
application needs a way of accessing that information. This is done by
binding the form elements to variables in your application. When the user
submits the form, WebObjects puts the data into the variables you’ve
specified.
Then, your application typically processes the data and returns a new page
(or the same page) displaying information that makes sense based on the
user’s input. The information displayed is usually represented by other
dynamic elements that are bound to variables and methods in your code.
This process of receiving a request (triggered by actions such as submitting
a form or clicking a hyperlink) and responding by returning a page is known
as the request-response loop. This loop is at the heart of WebObjects
programming.
In this tutorial, you’ll have WebObjects return the same page, with the
information you received from the user displayed, in a slightly different
format, at the bottom. In the second chapter, you’ll add an additional page
to your application.
Creating Variables
In this section, you’ll declare individual variables in your code file (
Main.java
)
to hold the name, e-mail address, and comments entered by a single guest.
Later on, you’ll structure this information differently in order to work with
data from multiple users.