Documentation Archive Developer
Search
Table of Contents Previous Section

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:

In this tutorial, the only attribute you are concerned with is value, which represents the string entered by the user in the comments field. You'll bind this to the comments variable. You don't need to bind the name attribute in this application. In a later example, you'll bind more than one attribute of an element.

  1. In the object browser, click the comments variable and drag the cursor into the Comments text area. Then release the mouse button.

    The Inspector window comes to the front, displaying the bindings for the text area. The value attribute is automatically selected (since that is the one that is most commonly used in bindings). If you wanted to choose a different attribute to bind (you don't at this time), you would simply select the binding of your choice.

  2. Click Connect Variable.

    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.

    Note: you can also bind a variable by typing its name directly in the Binding column for the desired attribute.

  3. In the same way, bind the guestName and email variables to the two text fields.

  4. Save the Main component.

Table of Contents Next Section