Binding the Input Elements
Each dynamic element contains several attributes. These attributes determine what happens when the element is displayed or when a form element is submitted. When you bind an element, you actually bind one or more of its attributes. For example, a WOText element (which represents a multi-line text area) is defined as having two attributes:-
value specifies the string the user enters in the text area.
- name specifies a unique identifier for the text area.
-
In the object browser, make a connection by pressing on the comments variable and holding down the mouse button while dragging to the Comments text area. Then release the mouse button.
-
Choose value.
In the Dynamic Inspector, comments appears in the Binding column next to the value attribute of the text area, indicating that the binding has been made. Also, the text comments appears in the text field to show that it has been bound.
-
We'll bind the guestName variable using another technique. Select the Name WOTextField element. In the Inspector, select the Dynamic Inspector.
The Inspector displays the value attribute in red, indicating that this attribute must be bound; otherwise, WebObjects displays an error message when you try to run your application.
-
In the Inspector, double-click in the Binding column next to value. Type g and press Enter. The Inspector fills in the rest of the "guestName" key for you.
-
Bind the email variable to the corresponding text field using one of the methods above.
- Save the Main component.
© 1999 Apple Computer, Inc. (Last Updated 24 Aug 99)