Programmatically adding objects to an Iterator for ADF or BPM Arrays

This one took a week to figure out as I was new to ADF at the time but here it is:

Main Method:

//Iterate Control Tests
DCBindingContainer iteratorBindings =
(DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding myIterator= iteratorBindings.findIteratorBinding(“dataControlIterator”);

RowSetIterator rsi = myIterator.getRowSetIterator();

for (MyObject object : myObjectList) {
Row lastRow = rsi.last();

int lastRowIndex = rsi.getRangeIndexOf(lastRow);

Row newRow = rsi.createRow();


newRow = setRowEditable(newRow);

newRow.setAttribute(“attributeName”, object .getId());


rsi.insertRowAtRangeIndex(lastRowIndex + 1, newRow);



Utility Methods:

public Row setRowEditable(Row row) {
int attribCount = row.getAttributeCount();
for (int i = 0; i < attribCount; i++) {
ViewAttributeDefImpl attrDef = (ViewAttributeDefImpl) row.getStructureDef().getAttributeDef(i);
return row;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s