Where can I see Binding Model Parameter Options?
To answer this question let us start building an application and see where we really use this in real life.
Follow the steps given below.
1. Here, I assume that you already have one Fusion Web Application in place, with Application Module defined. Please refer Fusion Developer's Guide for Oracle Application Development Framework in case you are not familiar with building Fusion Web Application.
2. Now generate java files for your Application Module.
3. Go to the generated ApplicationModule implemenetation file(<YourApplicationModuleName>Impl.java) and define a method which takes atleast one parameter as argument. Let it be, public void doSomething(String someArg){}
4. Generate the Java Cleint Interface for this, so that this method can be wired with a web page (jspx, jsp or jsff) using DataControl.
5. Now, select the ViewController project, then create a jspx file.
OK, so far so good. Now let us try defining the binding for this Application Module method.
Please refer 11 Using Oracle ADF Model in a Fusion Web Application if you are not familiar with data binding.
6. Select the binding tab for the jspx, click on '+', this would display Insert Item dialog. Now select methodAction clik OK. 'Create Action Binding' dialog appears as shown below.
Lower half of the dialog displays a Parameter (Binding Model Parameter) table, where the details of method parameters can be found. All columns in the table are self explanatory, except the last two. Value column can have either binding expression or literal values such as constants. In the last column 'Option', you can find a drop down with options as Final, Mandatory and Optional.
Curious to know the significance of the Binding Model Parameter Options? Let me try explaining this with an example
Final, Mandatory, Otional
Below scenarios describe possible parameter options and their influence on the parameter value being passed at runtime.
Final
Final implies that value for parameter can be retrieved by evaluating the specified binding expression, no need to look anywhere else. This indicates that parameter value cannot be set explicitly set by a caller.
The binding model parameter is configured as shown below in the picture
Assume that backing bean code invokes this method action in response to some user action. The method invocation part may look like as below
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");
opb.invoke();
What would be the Input to the method at runtime with the above configuration?
In this case final value being passed for parameter would be the 'evaluated value' of this Expression Language (EL) #{SomeBean.someParam}.
Mandatory
Binding Model Parameter value has to be set by the caller, always. EL or literal value specified in the binding definition will never be considered if the parameter option specified is Mandatory.
The binding model parameter is configured as shown below in the picture
The method invocation part from the backing bean may look like as below
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");
opb.invoke();
What would be the Input to the method at runtime with the above configuration?
Value of parameter would be 'someValue' supplied by caller, won't consider value defined in your binding definition
Optional
Binding definition's value is used only if the caller does not specifically set the parameter. Parameter value defined in your BindingDefinition (pagedef file) is with least precedence here, just opposite to Final.
The binding model parameter is configured as shown below in the picture
The method invokation part from the backing bean may look like as below
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");
opb.invoke();
What would be the Input to the method at runtime with the above configuration?
Value of parameter would be 'someValue' supplied by caller.

