Skip to main content

QOW #2: What is wrong in my action binding setting?

See the answer for last QOW#1 here

QOW#2 (14 July 2013):
This time it's easy:)
I've exposed a method from AM that takes two parameters,  public void findEmps(String firstName, String email). Exposed it through data control for use by client and then dropped it as methodAction to a JSF page, binding to a af:commandButton. While dropping the method, I used the following setting in the editor. Do you see anything wrong here?

Answer (Updated on 21 July 2013)

Both Thanvir  Parthan and Sharath Ram has done a great job in answering this query, and in fact nothing is left to me in answering this one except sharing link to one of my old post.  Read this post -

To summarize the answer, while defining parameters for an action binding, better do not set any value for Option type.  If you specify Option as Mandatory, you are telling framework that do not consider the EL or literal value specified in the binding definition, so parameter value may come as null if you use this method action binding from UI.  With this setting, you may want to use OperationBinding API for invoking this method action definition passing the value as parameter map

 DCBindingContainer bc = (DCBindingContainer)bcx.getCurrentBindingsEntry();
   OperationBinding opb = (OperationBinding)bc.getOperationBinding("someMethod");
   // someMethod is with signature public void someMethod(String someArg)
   opb.getParamsMap().put("someArg", "someValue");


Tanvir Pathan said…
The email parameter is set as mandatory.
Sharath Ram said…
I guess you can still set the email parameter as mandatory but the value cannot be passed from a binding definition?

The email parameter has to be explicitly set.
Thank you all. Updated the post with the answer.

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…