Saturday, November 26, 2011

ADF: Panel Tabbed Inter-Region Communication through shared bean datacontrol

Tested with JDeveloper

Use Case

  • JSF Page with two tabs (Departments, Employees)
    image The DepartmentName is rendered as a command link. If the user clicks on a DepartmentName the view changes on to the Employees Tab and filters the data
  • In each tab there is an static adf region (bound to fragment based BTF)
In summary we need the following to do:
  • DepartmentName as command link
  • View switches to the Employees Tab
  • Tab text should change to “Employees (<DepartmentName>)
  • On the employees tab - of course – only the corresponding entries should be displayed
  • The employees tab contains a button to remove the “global” filter.

How to do it?

Create DataExchange Bean as follows
public class DeptEmpExchange {
    private Number deptId;
    private String deptName;
    public DeptEmpExchange() {
        System.out.println("DeptEmpExchange created " + this);
    public void setDeptId(Number deptId) {
        this.deptId = deptId;
    public Number getDeptId() {
        return deptId;
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    public String getDeptName() {
        return deptName;
     * Exposed as DC Operation.
     * Called from the dept btf
     * @param deptId
     * @param deptName
    public void onDepartmentChange(final Number deptId,
                                   final String deptName) {
        System.out.println("onDepartmentExchange called: " + deptId + "/" + deptName);
        View1Bean view1 = (View1Bean)JSFUtils.resolveExpression("#{View1Bean}");
        view1.setEmpTabText("Employees ("+deptName+")");
And expose as JavaBean DataControl.
Now, on depts page fragment: drop the exposed operation onto the command link and provide the parameters from the current row.
The refresh of the panel tabbed is done programmatically in the onDepartmentChange(..) method. In order to refresh the emp btf with the new dept id configure the following bindings / properties on the main page
- create an attribute binding on the deptId from the DeptEmpExchange Bean.
- bind the tf input parameter to the attribute binding
- do not forget to set refresh=ifNeeded => this causes the btf to refresh in case the input params will change.
Implementing the “remove global filter” functionality is pretty simple. Just drag the onDepartmentChange-Operation from the data control palette on to the toolbar and adjust the text.

I hope I have not forgotten any important steps.

Download JDev11112Workspace

Update on Dec 19th 2011: Added Sample Application

Thursday, November 24, 2011

ADF Faces: Navigate on Checkbox selection

Used in Version:

As you may have noticed there is no action attribute on af:selectBooleanCheckbox. So how could you trigger a navigation case if user changed selection state of the checkbox.

In a customers scenario I need to trigger a navigation in a BTF from a checkbox insige a jsff

<af:selectBooleanCheckbox label="Klick me" id="sbc1"

image looks like

 public void setSelected(String value) {
final FacesContext context = FacesContext.getCurrentInstance();

if ("true".equalsIgnoreCase(value)) {
// checkbox is selected

// checkbox is not selected

Tuesday, November 22, 2011

ADF Talk on Youtube started

Today Ulrich and me started a series of sessions on ADF Topics.

In ADF Talk Session 1 we are introducing a way to integrate PL/SQL Code into ADF fusion applications. The video shows the usage of custom jdeveloper extension: TEAM Application Module from Database Package. See it in action.

Monday, November 21, 2011

My DOAG 2011 Slides – Upgrade Guide for Oracle ADF on WebLogic Server

Just translated my german slides from DOAG 2011 and uploaded those to slideshare.
Hopefully someone will find it useful. At the conference there were just too few attendees…

Friday, November 11, 2011

ADF - clicktoedit table, createinsert, rollback bug?

ADF version:
Firefox: 5.0


-Using ADF BC
-Create the most simple jsf page declarativly (no custom java code)
--table features: single selection, sorting, filtering
--change table attributes: editingMode=clickToEdit

Steps to reproduce

1. start


[notice the yellow marked rows.]

2. Now Click on CreateInsert


OK, new row is inserted and can be edited now.

3. Click on Rollback-Button (or Execute-Button)


What happened to the last two rows?

Further issue: clicktoedit not working on some rows


You may click as often you want. The row won't change into edit mode. In the log window you will see

<FacesCtrlHierBinding$FacesModel> <makeCurrent> ADFv: Keine Zeile gefunden für rowKey: [oracle.jbo.Key[191 ]].

Known workaround so far

1. Click the Execute-Button after Rollback.

2. Bind Rollback action to a backing bean method and do the following (Rollback + setActiveRowKey)

* Rollsback and Re-Executes the table iterator
* @param actionEvent
public void onRollback(ActionEvent actionEvent) {
    final DCBindingContainer bc = (DCBindingContainer)getBindings();


* @param bc
private void setActiveRowKey(final DCBindingContainer bc) {
    final DCIteratorBinding empIter = bc.findIteratorBinding("EmployeesView1Iterator");
    final Row newRow = empIter.getCurrentRow();
    final ArrayList activeRowKeyList = new ArrayList();

public BindingContainer getBindings(){
    return BindingContext.getCurrent().getCurrentBindingsEntry();


Sample Application:

Similiar issues

JDev – Clear WLS Log tab Bug?

Applies to JDeveloper:

Problem Description

After starting the integrated WLS from JDev the wls log is displayed in the log tab. Open mouse context menu and “clear” item is not activated


I have no chance to clear the log tab!! Arghh.

Is there any good reason for this behaviour? ( not beeing able to clear the log). The memory consumption is already enormous. Dear Oracle, please let me clear the log tab again…

Never seen this issue in 11gR1 versions.

Is there any workaround?