Apr 8, 2016

Programmatically get and set Iterator Key value from Managed Bean

Sometimes we need to set current row after performing some action like Rollback or Execute.



BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = (DCIteratorBinding) bindings.get("EmployeesIterator");
oracle.jbo.Key empKey = null;

// get key value of current row

                if (iter.getEstimatedRowCount() > 1) {
                    if (iter.getCurrentRow() != null) {
                        empKey = iter.getCurrentRow().getKey();
                    }
                }

// Perform action you want to do here

// set ket value of current row

            if (empKey != null) {
                iter.setCurrentRowWithKey(empKey.toStringFormat(true));
            }



Programmatically Call and execute Iterator from Managed Bean

Below code is use to get Iterator and Execute Iterator:-

BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter= (DCIteratorBinding) bindings.get("EmployeeIterator");
iter.executeQuery();