Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Getting Started With WebObjects


   

Binding the Class's Instance Variables
to the Form Elements

In the first chapter, you bound the input elements to variables in Main's code. Now you'll modify the bindings to use the class you just created.

  1. Select Web Components in the first column of the browser.

  2. Double-click Main.wo in the second column of the browser to open the component in WebObjects Builder.

  3. Using the Add Key panel, add a variable called currentGuest to your component and specify its type as Guest. (Note that you can now choose Guest from the Type combo box.)

    An entry for currentGuest appears in the object browser. Notice the ">" symbol to the right of its name. This means that there is additional data to be displayed in the second column.

  4. Select currentGuest in the object browser.

    The second column displays the three fields of currentGuest, as determined by the definition of its class, Guest.

  5. Make a connection from guestName in the second column of the object browser (next to currentGuest) to the Name text field (press the mouse button down on the variable, drag to the element, and release the mouse button), and click value in the pop-up menu.

    This time, when the pop-up menu appears, there is a dot next to the value attribute because you bound it in the first tutorial.

  6. Bind the other two input elements to currentGuest.email and currentGuest.comments.


© 1999 Apple Computer, Inc. – (Last Updated 24 Aug 99)