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, click the comments variable and drag the cursor into the Comments text area. Then release the mouse button.
- Click Connect Variable.
- In the same way, bind the guestName and email variables to the two text fields.
- Save the Main component.
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.
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.
Table of Contents Next Section