Oracle® Application Development Framework Developer's Guide 10g (10.1.3.1.0) Part Number B28967-01 |
|
|
View PDF |
To bind existing components to ADF data controls, you must add ADF binding expressions to the component tags. While you could manually add ADF binding expressions to existing tags, it is easier to use the Data Control Palette. Using the Data Control Palette ensures that all the necessary binding objects and references are automatically created for you. (For more information see, Section 13.3.2, "What Happens When You Use the Data Control Palette to Add ADF Bindings".)
The following procedure is a general description of how to use the Data Control Palette and the Structure window to add ADF bindings to existing components. Later sections in this chapter describe how to add ADF bindings to specific types of components.
To add ADF bindings using the Data Control Palette and Structure Window:
With your page displayed in the Design page of the visual editor, open the Structure window.
Tip: You can drop the data control object on the component displayed in the Design page of the visual editor, but using the Structure window provides greater accuracy and precision. For example, if you try dropping a data control object on a component in the visual editor and do not get the Bind Existing <component name> option in the context menu, this means you did not drop the data control on the correct tag in the visual editor. In this case, try using the Structure window where each tag is clearly delineated. |
In the Design page of the visual editor, select the UI component to which you want to add ADF bindings.
The component must be one of the tags listed in Table 13-1. When you select a component in the visual editor, JDeveloper simultaneously selects that component tag in the Structure window, as shown in Figure 13-1. Use the Structure window to verify that you have selected the correct component. If the incorrect component is selected, make the adjustment in the Structure window.
Drag the appropriate data control object from the Data Control Palette to the Structure window and drop it on the selected UI component. (For information about the nodes on the Data Control Palette, see Section 5.2.1, "How to Understand the Items on the Data Control Palette".)
Tip: As you position the data control object over the UI component in the Structure window, a horizontal line with an embedded up or down arrow appears at the top or bottom of the component, as shown in Figure 13-2. Whenever either of these lines appears, you can drop the data control object: in this case, it does not matter which direction the arrow is pointing. |
From the Data Control Palette context menu, choose the Bind Existing <component name> option, where <component name> is the name of the component, such as text field or table, as shown in Figure 13-3.
Tip: If the context menu does not display a Bind Existing <component name> option, you have not dropped the data control object on the correct tag in the Structure window. You can add bindings only to the tags shown in Table 13-1. |
When you use the Data Control Palette all of the required ADF objects are automatically created for you:
The DataBindings.cpx
file is created and a corresponding entry for the page is added to it.
The ADF binding filter is registered in the web.xml
file.
The ADF phase listener is registered in the faces-config.xml
file.
A page definition file is created and configured with the binding object definitions for component on the page.
All of these objects are required for a component with ADF bindings to be rendered correctly on a page. If you do not use the Data Control Palette, you will have to create these things manually. For more information about these objects, see Chapter 5, "Displaying Data on a Page".