Monday, May 10, 2010

Action Bindings and Method Bindings in Oracle ADF 11g

PageDef.xml is the page definition XML file. It associates web page UI components with data, or data controls. Oracle JDeveloper creates this file each time you design a new web page using the Data Controls Panel or Structure window. These XML files contain the meta data used to create the bindings that populate the data in the web page’s UI components. For every web page that refers to an ADF binding, there must be a corresponding page definition file with binding definitions.

In the overview editor for any page definition’s Bindings and Executables tab, click the Add icon in the Bindings section. From the Insert Item dialog, you're allowed to choose either action or methodAction binding object to create as shown below:
The description for the action item is "Binding for Action." So, it is named action binding. The description for the methodAction item is "Method binding for the Control." It is also known as method binding. In this article, we'll examine what're the differences and similarities of these two binding objects.

Acronyms

  1. ADFm: ADF Model layer
  2. ADFc: ADF Controller
  3. ADFv: ADF View layer
  4. EL: Expression Language

Action Binding

Action binding object can be used to bind command components, such as buttons or links, to built-in data control operations (such as Commit or Rollback) or to built-in collection-level operations (such as Create, Delete, Next, Previous, or ExecuteWithParams).

Action binding is defined in the page definition using the following attributes:




































Attributes
Attribute
Description
Action

Fully qualified package name. Identifies the class for which the data control is created. In the case of the EJB session facade, this is the session bean.

BindingClass

This is for backward compatibility to indicate which class implements the runtime for this binding definition. This is used by earlier versions of
JDeveloper.

DataControl

Name of the DataControl usage in the bindingContext (.cpx) which this iteratorBinding or actionBinding is associated with.

Execute

Used by default when you drop an operation from the Data Controls Panel in the automatically configured ActionListener property. It results in executing the action binding's operation at runtime.

InstanceName

Specifies the instance name for the action.

IterBinding

Specifies the iteratorBinding instance in this bindingContainer to which this binding is associated.

Outcome

Use if you want to use the result of a method action binding (once converted to a String) as a JSF navigation outcome name.


For example, ExecuteWithParams (i.e., a built-in collection-level operation) is defined in a page definition file as:
<bindings>
<action IterBinding="TestTrendIterator" id="ExecuteWithParams"
RequiresUpdateModel="true" Action="executeWithParams">
<NamedData NDName="TSBegin" NDType="java.sql.Date"
NDValue="${bindings.ExecuteWithParams_TSBegin}"/>
<NamedData NDName="TSEnd" NDType="java.sql.Date"
NDValue="${bindings.ExecuteWithParams_TSEnd}"/>
</action>
</bindings>

Note that ExecuteWithParams on our view object (not shown here) takes two parameters:
  1. TSBegin
  2. TSEnd
These two parameters are defined to be optional (i.e., NDOption="optional") by default. This means that if you didn't provide new values programmatically at runtime, their values will be taken from meta data (i.e., ${bindings.ExecuteWithParams_TSXxx}) as provided in the action binding. See this article, for the descriptions of binding model parameter options (i.e., NDOption).

Method Binding

Method bindings are similar to action bindings. But, they are used to bind to methods defined in an ADF BC application, view object, or view row client interfaces.

Method binding is defined in the page definition using the following attributes:

























































Attributes
Attribute
Description
Action

Fully qualified package name. Identifies the class for which the data control is created. In the case of the EJB session facade, this is the session bean.

BindingClass

This is for backward compatibility to indicate which class implements the runtime for this binding definition. This is used by earlier versions of
JDeveloper.

ClassName

This is the class to which the method being invoked belongs.

DataControl

Name of the DataControl usage in the bindingContext (.cpx) which this methodAction is associated with.

DefClass

Used internally by ADF.

id

Unique identifier. May be referenced by any ADF action binding.

InstanceName

A dot-separated EL path to a Java object instance on which the associated method is to be invoked.

IsLocalObjectReference

Set to true if the instanceName contains an EL path relative to this bindingContainer.

IsViewObjectMethod

Set to true if the instanceName contains an instance path relative to the associated data control's application module.

MethodNameIndicates the name of the operation on the given instance or class that needs to be invoked for this methodActionBinding.
RequiresUpdateModelWhether this action requires that the model be updated
before the action is to be invoked.
ReturnNameThe EL path of the result returned by the associated method.

For example, myCustomMethod defined in an ADF BC application is defined to be:
<bindings>
<methodAction id="myCustomMethod"
InstanceName="SelTestPortalAMDataControl.dataProvider"
DataControl="SelTestPortalAMDataControl"
RequiresUpdateModel="true" Action="invokeMethod"
MethodName="refreshTotalComments" IsViewObjectMethod="false"/>
</bindings>

How to Access Action/Method Bindings in an Fusion Web Application

When working with Fusion web applications using the ADF Model layer for data binding, JDeveloper configures a servlet filter in your user interface project called the ADFBindingFilter. It orchestrates the automatic acquisition and release of an appropriate application module instance based on declarative binding metadata, and ensures that the service is available to be looked up as a data control using a known action binding or iterator binding, specified by any page definition file in the user interface project.

No matter what a binding object is (i.e., action binding or method binding), they are retrieved and invoked in the same way when accessed from Fusion Web Applications:
  • Retrieve them from the DCBindingContainer (i.e., the runtime object that embodies the meta data defined in the page definition) by naming an action binding or method binding.
Method bindings such as myCustomMethod, or action bindings such as Next, Previous or ExectureWithParams, exposed on a view object are instance of JUCtrlActionBinding that can be cast to the OperationBinding interface when accessed from Java:
BindingContext context = BindingContext.getCurrent();
DCBindingContainer bindingContainer = (DCBindingContainer) context.getCurrentBindingsEntry();
OperationBinding oper = bindingContainer.getOperationBinding("openSubTask");
...
oper.execute();

FacesCtrlAttrsBinding


Internally JUCtrlActionBinding is an FacesCtrlActionBinding, which is the class that connects ADFv[1] command components to ADFc[2]/ADFm[3]. Like other ADFv binding classes, this is a sub-class of an ADFm class. And like other ADFm bindings there is an entry in the pageDef.xml file for this binding (i.e., action or method binding). If the method has either parameters or a return, there will be additional attribute bindings corresponding to the parameter and return values. These attribute bindings will correspond to a FacesCtrlAttrsBinding class and be in the pageDef.xml file.

The ADFv command components that use this class are:
  • commandLink
  • commandButton,
  • commandMenuItem
  • commandToobarButton
  • commandImageLink.
and they are linked to this class via EL[4] on the component, typically the actionListener attribute.

Learn More
  1. Implement Contextual Events
  2. Oracle ADF Model In Depth
  3. Oracle ADF BindingContext and BindingContainer
  4. Open Source sample applications for Oracle Fusion Middleware technology
  5. How-To Access ADF application module with ADF faces (see Steve Muench's comments)

10 comments:

werwer said...

The most up-to-date variation is carefully suitable with all Windows model around Windows 10.
Typing Master Full Version Free Download With Key may also help clients improve typing speed by accomplishing a spread of checks and packages. It's really not offering only rather simple learning

Jonny Sin said...

AVG Secure VPN Crack Excellent piece of work, and I am in wonder how you manage all of these content and his entry. I would like to say you have superb capabilities related to your work, and lastly, please keep it up because I am looking for the more.
And Also Visit This Site ProCrackerz

Naeem Shah said...

There we go! This is the best blog entry I've ever read!
While reading your post, I was transported back to my comfortable living room.
friend! He'd always bring it up.
This is the article I'd want to pass along to you.
It's going to be an enjoyable read, no doubt. I appreciate you sharing this with us.
n track studio crack
keepvid music tag editor crack
advanced systemcare ultimate crack
nero burning crack
microsoft office 2007 crack
pinnacle studio crack
wondershare pdfelement pro crack
solveigmm video splitter crack

safu said...

Your writing abilities are genuinely remarkable.
I also admire your writing abilities.
artisteer crack
macromedia flash Crack
malwarebytes anti malware crack
kaspersky internet security crack

Buttler said...

I saw your writing skills. Your writing skills are amazing. I also really like your ability to write.
Your writing skills have given me a lot of perspective on this subject. I think you're an old blogger.
apfs for windows crack
mixxx crack
spark crack
n track studio crack
windows 10 pro crack
hard disk sentinel pro crack
mirillis action crack
quarkxpress crack

BaskinoHD said...

A PSA (Public Service Announcement) is a short video informational clip that is meant to raise awareness about an important cause, and/or issue. PSAs may include videos, animations, interviews, dramatizations, and many other types of visual content. Mechanism of Action

freeactivationkey said...

I know you are doing a good job. I have read your blog. It is really wonderful. The work is being done in a very good way. If you keep working in this way, your blog will definitely come out.Reflector Pro Crack
DriverPack Solution Crack
SoftPerfect NetWorx Crack
Marmoset Toolbag Crack
ObjectDock Crack
Smart Driver Updater Crack
DxO PhotoLab Crack
Sony Vegas Pro Crack
Freemake Video Converter Crack
Advanced SystemCare Pro Crack

Saad Techs said...

Thank you for sharing this article. This article is really informative.

DAEMON Tools Ultra Crack

ApowerMirror Crack

Redshift Render Crack

Minecraft Crack

Burp Suite Pro Crack

ReiBoot Pro Crack

Maharpc said...

Imyfone Lockwiper Registration code users can easily remove the passcode from their iOS devices without the need for technical expertise or assistance from Apple. The software can also bypass other types of locks, such as Touch ID and Face ID, allowing users to regain access to their devices.

Maharpc said...

Hard Disk Sentinel Crack It can be used to diagnose and detect any issues with your storage devices, including potential failures, and provide alerts and notifications if any problems are detected.