Thursday, March 1, 2012

How-to: Find row in ADF Iterator and remove row from Iterator

To find row in ADF Iterator by key  you can use below code:

DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter =
              (DCIteratorBinding)bc.findIteratorBinding("YourViewName1Iterator");
String keyValue="123"; 
Key key = new Key(new Object[] { keyValue });
RowSetIterator rsi = iter.getRowSetIterator();
Row row = rsi.findByKey(key, 1)[0];

Next you can set the found row as the current row:
rsi.setCurrentRow(row);

and remove row from Iterator:
iter.removeCurrentRow();

No comments:

Post a Comment