As part of configuring your project for working with Oracle ADF data binding, JDeveloper registers an additional handler that is triggered whenever a client requests a JSP page. This handler is listed in the standard J2EE web application configuration file (web.xml) of your ViewController project. It sets up the correct binding container for the current page based on the related ADF Model XML configuration files, and makes it accessible using the EL expression #{bindings}. During the subsequent handling of the web page request, the JSF standard dictates a predictable set of processing steps known as the page "lifecycle".
At runtime, multiple objects (i.e., binding context, binding containers, and binding objects) are created in memory to hold binding information. The ADF binding context is a runtime map of all data controls and page definitions within the application. The binding context is the one object that lives in the HttpSession for each end user, accessible using the EL expression #{data}.
The group of bindings supporting the UI components on a page are described in a 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, accessible during each page request using the EL expression #{bindings}. This expression always evaluates to the binding container for the current page.
At runtime, multiple objects (i.e., binding context, binding containers, and binding objects) are created in memory to hold binding information. The ADF binding context is a runtime map of all data controls and page definitions within the application. The binding context is the one object that lives in the HttpSession for each end user, accessible using the EL expression #{data}.
The group of bindings supporting the UI components on a page are described in a 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, accessible during each page request using the EL expression #{bindings}. This expression always evaluates to the binding container for the current page.
- Binding Context
- The binding context provides the data environment for your application. It contains all of the data controls and binding containers that your application can access.
- The ADF lifecycle creates the ADF binding context from the application module,DataBindings.cpx, and page definition files. Binding context contains references that become data control or binding container objects on demand.
- You can look up ApplicationModule from a managed bean using the BindingContext:
BindingContext bc = BindingContext.getCurrent(); DCDataControl dc = bc.findDataControl("AppModuleDataControl"); ApplicationModule am = (ApplicationModule)dc.getDataProvider();
- You can retrieve a ControlBinding named "producerMethod" via BindingContext in this way:
DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); JUCtrlActionBinding actionBnd = (JUCtrlActionBinding)bc.getControlBinding("producerMethod");
- Binding Containers
- A binding container holds value bindings and iterator bindings (or binding objects) for a page. It provides runtime access to all the ADF binding objects for a page.
These objects in the ADF model layer provide runtime access to business services:
- binding context object (
oracle.adf.model.BindingContext
) - Defines a common namespace for use by the client application and allows all model objects to be exposed through a convenient root name. Each web page or Java panel registers with the binding context using the definition for the variable name
binding
. - data control interfaces (
oracle.adf.model.binding.DCDataContro
l
) - Provides the client application with an interface into the model objects. One data control is needed to wrap the model objects of each business service configuration. Also, in the case of a JavaBeans model object, provides developers with direct access to the native object, when programmatic access is desired.
- binding container objects (
oracle.adf.model.binding.DCBindingContainer
) - Defines a container for data binding objects, including iterator bindings and control bindings. One binding container is created for each web page or Java panel, but may be reused in multiple pages and panels when they share the same data. The binding container object also lets you specify whether the page or panel is to be used in data entry mode or query mode.
- iterator binding objects (
oracle.adf.model.binding.DCIteratorBindin
g
) - Handles the events generated from the associated business service row iterator and sends the current row to individual control bindings to display current data. Iterator bindings can specify the number of rows to display in a web page.
- control binding objects (
oracle.jbo.uicli.binding.JUControlBinding
) - Defines the way a specific UI component interacts with the corresponding business service. For example, depending upon the control binding selection, a text field may be bound to an Oracle ADF Business Components view object attribute and display as an editable field or a static label. Or, if the business service attribute defines an enumerated list of values, the bound UI component might display a static list, a single-selection list, or a multi-selection list. Other, more complex UI components, such as table and graphs, are also supported by their own control bindings.
- action binding objects (
oracle.jbo.uicli.binding.JUCtrlActionBinding
) - At runtime, when the user initiates the action, using a button control, the action binding accesses the Oracle ADF binding context and initiates the specified action on the data objects of the selected collection. Action bindings can take parameters that will be passed to the controller to handle.
No comments:
Post a Comment