Introduction to ADF Model Data Binding

2 Using ADF Model Data Binding in a Java EE Web Application 2-1 2 Using ADF Model Data Binding in a Java EE Web Application ADF Model is a declarative data binding facility that implements the JSR-227 specification. This specification provides an API for accessing declarative data binding metadata. The ADF Model layer enables a unified approach to bind any user interface to any business service with no code. This chapter provides a brief overview of ADF Model data binding. For more comprehensive information about using ADF Model data binding, refer to the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. This chapter includes the following sections: ■ Section 2.1, Introduction to ADF Model Data Binding ■ Section 2.2, Exposing Services with ADF Data Controls ■ Section 2.3, Using the Data Controls Panel

2.1 Introduction to ADF Model Data Binding

ADF Model implements the two concepts in JSR-227 that enable decoupling the user interface technology from the business service implementation: data controls and declarative bindings. Data controls abstract the implementation technology of a business service by using standard metadata interfaces to describe the bean’s operations and data collections, including information about the properties, methods, and types involved. Using JDeveloper, you can view that information as icons which you can drag and drop onto a page. Using those icons, you can create databound HTML elements for JSP pages, databound UI components for JSF pages, and databound Swing UI components for ADF Swing panels by dragging and dropping them from the panel onto the visual editor for a page. JDeveloper automatically creates the metadata that describes the bindings from the page to the services. At runtime, the ADF Model layer reads the metadata information from the appropriate XML files for both the data controls and the bindings, and then implements the two-way connection between your user interface and your business services. Declarative bindings abstract the details of accessing data from data collections in a data control and of invoking its operations. There are three basic kinds of declarative binding objects: ■ Executable bindings: Include iterator bindings, which simplify the building of user interfaces that allow scrolling and paging through collections of data and drilling-down from summary to detail information. Executable bindings also 2-2 Java EE Developers Guide for Oracle Application Development Framework include bindings that allow searching and nesting a series of pages within another page. ■ Value bindings: Used by UI components that display data. Value bindings range from the most basic variety that work with a simple text field to more sophisticated list and tree bindings that support the additional needs of list, table, and tree UI controls. ■ Action bindings: Used by UI command components like hyperlinks or buttons to invoke built-in or custom operations on data collections or a data control without writing code. Figure 2–1 shows how bindings connect UI components to data control collections and methods. Figure 2–1 Bindings Connect UI Components to Data Controls The group of bindings supporting the UI components on a page are described in a page-specific XML file called the page definition file. The ADF Model layer uses this file at runtime to instantiate the page’s bindings. These bindings are held in a request-scoped map called the binding container. In a JSF application, the binding container is accessible during each page request using the EL expression {bindings} . Tip: For more information about ADF EL expressions, see the Creating ADF Data Binding EL Expressions section of the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. Using ADF Model Data Binding in a Java EE Web Application 2-3 To use the ADF Model layer to data-bind, you need to create a data control for your services. The data controls will then appear as icons in the Data Controls panel, which you can use to declaratively create pages whose components will be automatically bound to those services.

2.2 Exposing Services with ADF Data Controls