Binding Elements
This section discusses the basic techniques you use to bind elements. Further detail is presented in the sections that discuss specific dynamic elements.
In the figure, you have added a form (WOForm) containing a dynamic text field (WOTextField) to your component. Note the triangle in the top left corner, which distinguishes the dynamic text field from a static HTML text field. The long rectangle surrounding the text field represents the containing form.
To bind the text field to the variable myVar :
-
Press mouse down on myVar
in the object browser and drag to inside the text field.
- Release the mouse button. A menu containing the attributes for that element appears.
-
To complete the binding, click the attribute you want to bind (value in this case.)
In the inspector, which you can access by clicking
in the toolbar, the name of the variable appears in the Binding column next to the attribute. Note that it also appears in blue inside the text field in the component window. Some (not all) dynamic elements display the binding for their default attribute inside the element itself.
-
Double-click in the binding column of the row for the attribute you want to set.
- Type the binding in the text field. As you type, WebObjects Builder attempts to complete the binding using keys in the object browser.
- When the desired key appears in the binding column, press Enter.
- Constant strings (such as "Joe" ) must be in double quotes.
- Variable and method names (such as joe ) must not be in quotes.
- Symbolic constants (such as YES and NO ) must not be in quotes.
- Keys must specify their full key path . For example, to bind the key that is selected in the following figure, you would type "a.a.c" to select application.allGuests.count .
Deleting Bindings
Other Binding Commands
© 1999 Apple Computer, Inc. (Last Updated July 27 99)