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 Manages named variables and their values. The bind variable value set by calling VariableValueManager::setVariableValue(...) may reflect across all RowSets if these RowSets have not set the bind variable values by calling RowSet::setNamedWhereClauseParam(...). Let me try to clarify this part. Please note that ADF BC enables each Rowset to have its own copy of bind variables to produce and process multiple row sets based on different combination of bind variable values. If you chose to call yourRowSet.setNamedWhereClauseParam(...), then this takes precedence over VariableValueManager's copy from the parent/owner ViewObject.
What you may need to know about setting values for Bind Variables when used inside a ViewCriteria?
You can assign the bind variable to a view criteria item. In this case, the bind variables allow you to change the values for attributes you will use to filter the view object row set. Please note that the Search Form built using ViewCriteria gets and sets bind variable values from the VariableValueManager of the ViewObject. This means that, if you need to initialize the bind variable values when used inside a ViewCriteria, please call VariableValueManager::setVariableValue(...). The ViewObject.setNamedWhereClauseParam(...) will not help you here.
ViewObject vo = am.findViewObject("EmployeesView1"); VariableValueManager vm = vo.ensureVariableManager(); vm.setVariableValue("bindVarDeptId", deptId);
Learn More ...
There are a lot more points like this. If you are curious to learn the internals of the ADF Business Components and ADF Binding Layer, the following book is for you - Oracle ADF Real World Developer’s Guide.
More details about this book can be found in this post- http://jobinesh.blogspot.in/2012/07/pre-order-your-copy-of-oracle-adf-real.html