Teki's blog

Tuesday, March 01, 2005

Oracle ADF - Refresh data from Bean collection

When working with the ADF Business Components data control, the view objects and entity objects have event notification in place that the ADF Business Components implementation of the ADF row set iterator responds intelligently to. So, ADF iterators working with ADF Business Components-based back-ends are always up to date with changes made to the collections. If you are working instead with data binding against simple Java classes and do something in your code to update a Collection-valued property, you need to manually trigger the rebuild of the iterator.

Here is a code to rebuild iterator:

DCIteratorBinding dcIterator= actionContext.getBindingContainer().findCtrlBinding("someCtrBinding").getDCIteratorBinding();
((DCRowSetIteratorImpl)(dcIterator.getRowSetIterator())).rebuildIteratorUpto(-1);