Skip Headers
Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers
10g (10.1.3.1.0)

Part Number B25947-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

21.4 Adding ADF Bindings to Text Fields

You bind forms or other container components by binding the individual text fields that comprise the component: you cannot bind an entire form at one time. You bind a text field to an attribute in a collection.

21.4.1 How to Add ADF Bindings to Text Fields

To add ADF bindings to a text field, you drag an attribute from the Data Control Palette and drop it on the text field component displayed in the Structure window. For general tips about dropping items from the Data Control Palette onto the Structure window, see Section 21.3.1, "How to Add ADF Bindings Using the Data Control Palette".

To add ADF bindings to a text field:

  1. With the page displayed in the Design page of the visual editor, open the Structure window.

  2. In Design page of the visual editor, select the text field.

    This simultaneously selects the tag in the Structure window. The text field tag must be one of the tags listed previously in Table 21-1. If the incorrect tag is selected, make the adjustment in the Structure window.

  3. From the Data Control Palette, drag an attribute to the Structure window and drop it on the selected text field.

  4. On the Data Control Palette context menu, choose Bind Existing Input Text.

    The binding is added to the text field.

21.4.2 What Happens When You Add ADF Bindings to a Text Field

Example 21-1 displays an input text field component before the ADF bindings are added. The example is a simple inputText tag with a static label value of First Name.

Example 21-1 Text Field Component Before ADF Bindings

<af:inputText label="First Name"/>

Example 21-2 displays the same text field after the FirstName attribute of the StaffList collection from the SRDemo data control was dropped on it. Notice that the label, which was a static string on the original tag, was replaced with a binding expression. To modify the label displayed by an ADF binding, you can use control hints. Other tag attributes have been added with bindings on different properties on the FirstName attribute. For a description of each binding property, see Appendix B, "Reference ADF Binding Properties".

Example 21-2 Text Field Component After ADF Bindings Are Added

<af:inputText label="#{bindings.StaffListFirstName.label}"
              value="#{bindings.StaffListFirstName.inputValue}"
              required="#{bindings.StaffListFirstName.mandatory}"
              columns="#{bindings.StaffListFirstName.displayWidth}">
  <af:validator binding="#{bindings.StaffListFirstName.validator}"/>
</af:inputText>

In addition to adding the bindings to the text field, JDeveloper automatically adds entries for the databound text field to the page definition file. The page definition entries include an iterator binding object defined in the executables element and a a value binding defined in the bindings element. For more information about databound text fields and forms, see Chapter 13, "Creating a Basic Page".