Refresh Page in Oracle ADF, Set partial trigger programmatically

Sharing is Caring

While working on projects sometimes we need to refresh page in Oracle ADF or any page component from managed bean code.

Java Code to refresh page in Oracle ADF

import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;

//Method to reload page
protected void refreshPage() {
FacesContext fctx = FacesContext.getCurrentInstance();
String page = fctx.getViewRoot().getViewId();
ViewHandler ViewH = fctx.getApplication().getViewHandler();
UIViewRoot UIV = ViewH.createView(fctx, page);
UIV.setViewId(page);
fctx.setViewRoot(UIV);

}

 

Partially refresh any UIComponent, Set partial trigger programmatically-

import oracle.adf.view.rich.context.AdfFacesContext;
AdfFacesContext.getCurrentInstance().addPartialTarget(UIComponentBinding);

 

 

 

Related Posts

I’m an Oracle ACE, Blogger, Reviewer,
Technical Lead working on Oracle ADF

Leave a Reply

Your email address will not be published. Required fields are marked *