Wednesday, August 27, 2014

Implement RegionController for executing a Method in backing bean before opening up a jsff page fragment

import oracle.adf.model.RegionBinding;
import oracle.adf.model.RegionContext;
import oracle.adf.model.RegionController;


public class BackingBean implements RegionController{
  

    public PostInspectBean() {
        super();
    }


    
    @Custom method
    public void loadJsffPage() {

     // your code goes here to execute the bindings or refresh the components on a page

    }
    
      @Override
      public boolean refreshRegion(RegionContext regionContext) {
        int refreshFlag = regionContext.getRefreshFlag();
        if(refreshFlag==RegionBinding.PREPARE_MODEL){
      

            loadJsffPage(); //custom method


        }
        regionContext.getRegionBinding().refresh(refreshFlag);
        return true;
      }
    @Override
    public boolean validateRegion(RegionContext regionContext) {
        regionContext.getRegionBinding().validate();
        return false;
    }
    @Override
    public boolean isRegionViewable(RegionContext regionContext) {
        return false;
    }
    @Override
    public String getName() {
        return null;
    }

    
}      
 

No comments: