Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Tools and Techniques

   

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 :

  1. Press mouse down on myVar in the object browser and drag to inside the text field.

    A black line appears as you drag, and a black border appears around the text field, indicating that you can bind to it.

  2. Release the mouse button.

    A menu containing the attributes for that element appears.

  3. 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.

You can also bind an element's attributes by typing in the Inspector directly. To do this:

  1. Double-click in the binding column of the row for the attribute you want to set.

    A cursor appears in the Binding column, allowing you to type.

  2. Type the binding in the text field. As you type, WebObjects Builder attempts to complete the binding using keys in the object browser.

  3. When the desired key appears in the binding column, press Enter.

When entering bindings this way, the following rules apply:

Deleting Bindings

Other Binding Commands


© 1999 Apple Computer, Inc. – (Last Updated July 27 99)