Saturday, August 31, 2013

ADF 11.1.2.1 - clicktoedit table, createinsert, rollback bug?

Steps to reproduce
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();
}

No comments:

Post a Comment