How to check whether ADF table row is modified or not.

How to check whether ADF table row is modified or not.

Sometimes we need to know whether any row of ADF table is modified or not using managed bean. Here’s a quick solution to find whether ADF table rows are modified or not.

 

There is a method in oracle.jbo.Transaction class called isDirty()  used to find row is modified or not.

  1. BindingContext bindingctx=BindingContext.getCurrent();  
  2.   
  3. BindingContainer binding=bindingctx.getCurrentBindingsEntry();  
  4.   
  5. DCBindingContainer bindingsImpl = (DCBindingContainer) binding;  
  6.   
  7. DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(“<b>iterName</b>”);  
  8.   
  9. ViewObject vo=dciter.getViewObject();  
  10.   
  11. boolean dirty=vo.getApplicationModule().getTransaction().isDirty();  
  1. BindingContext bindingctx=BindingContext.getCurrent();  
  2.   
  3. BindingContainer binding=bindingctx.getCurrentBindingsEntry();  
  4.   
  5. DCBindingContainer bindingsImpl = (DCBindingContainer) binding;  
  6.   
  7. DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(“<b>iterName</b>”);  
  8.   
  9. ViewObject vo=dciter.getViewObject();  
  10.   
  11. boolean dirty=vo.getApplicationModule().getTransaction().isDirty();  

iterName  is the Iterator name of ADF table find in page definition file. Boolean dirty will return true if table is modified.

About Manish Pandey

Manish is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply