Friday, November 11, 2011

ADF 11.1.2.1 - clicktoedit table, createinsert, rollback bug?

ADF version: 11.1.2.1
Firefox: 5.0

Prerequistes

-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 http://127.0.0.1:7101/TestInsertIntoClickToEditTable2-ViewController-context-root/faces/view1

0000@2660_2660-412669e935ee8dd8

[notice the yellow marked rows.]

2. Now Click on CreateInsert

0001@2660_2660-412669e9366af37c

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

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

0002@2660_2660-412669e937240796

What happened to the last two rows?

Further issue: clicktoedit not working on some rows

0003@2660_2660-412669e9385e0e69

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();
    bc.getOperationBinding("Rollback").execute();

    setActiveRowKey(bc);
}

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

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

Download

Sample Application: http://www.box.net/s/od2t8en8ojo3hho704uz

Similiar issues

http://adfbugs.blogspot.com/2010/03/rollback-does-not-refresh-current-row.html

No comments:

Post a Comment