Search Results


Thursday, October 30, 2014

How to programmatically make transactions Dirty

How to programmatically make transactions Dirty


Sometimes it is so convenient to use a POJO objects to save temporary values in the ADF pages. But the problem with this approach is that when the value is changed in the front end the DataControl layer is not aware of the actual changes and the transaction is not made dirty automatically. It may be good for many situation because thats the whole reason why we store some values in the the POJO object.


But just in case if you want to make the transaction dirty so that the control depending on the DataControl transaction will be aware of it. Following code could be used to make the transaction dirty in the ADF Data Control layer.

Following code works on jDeveloper 12c versions: and it should also work in 11g ADF versions.


import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCDataControl;

           BindingContext bindingContext = BindingContext.getCurrent();
           DCDataControl dc = bindingContext.findDataControl(“DataControlName”);
           dc.setTransactionModified();