Friday, April 9, 2010

Bit #8 - Executing an operation binding programmatically from a backing bean

To access an OperationBinding in a backing bean, call getOperationBinding() on the DCBindingContainer - the data control binding container - and specify the operation binding identifier that you assigned to the operation during the declarative binding process. Once you have the OperationBinding call its execute() method to execute it. If you need to pass any arguments to the operation, call getParamsMap() to get the operation parameters map and put() on the map the specific argument. Call getResult() after the call to execute() to retrieve the result of the execution. Here is an example.


        // in the context of a backing bean

         OperationBinding operation = bindings.getOperationBinding("operation_name");

         operation.getParamsMap().put("parameter_name", parameterValue);


         if (operation.getResult() != null) {
                  Boolean result = (Boolean) operation.getResult(); // cast to the expected result type


Backing Bean


  1. Whats a point in this, if you can get same info from Developer Guide?

  2. Hi there. Can you point me to where in the Developer Guide there is a single paragraph regarding this topic? Anyway, the topics listed here have a personal documentation usage. If they can be of help to anybody else this is added bonus as far as I concern.

  3. Thanks for this Nick.

    It may well be in the developer's guide but I found this before I was able to find it in the developer's guide.

  4. Thanks very much. This is a very useful tip. I have bookmarked your blog for reference!

  5. Hi,

    OperationBinding is available in two packages.. bu this bit never said to use ftom which package..

    Anyways Thanks for the help :)

  6. It should be OperationBinding interface from the the oracle.binding package.

  7. Very helpful tip. Thank you.

  8. Do you know if there's a difference between what's returned by the execute method and what's returned by getResult? Normally they seem to return the same, but once in a while it seem like only getResult works. A bit confused ;)

  9. Excellent post!! very helpful :)

  10. HI,

    Is there a way to retrieve the name of Iterator related to that OperationBinding programmatically ?



Related Posts Plugin for WordPress, Blogger...