27 September, 2012

ADF : Refresh Current Page


You can use the below code to refresh ADF page programatically

FacesContext context = FacesContext.getCurrentInstance()
String viewId = context.getViewRoot().getViewId()

ViewHandler vh = context.getApplication().getViewHandler()
UIViewRoot page = vh.createView(context, viewId);

context.setViewRoot(page);

Import the following classes
 
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;

Thanks

2 comments:

  1. Hello Mahmoud
    This code doesn't refresh the page at all but sets a viewId that is already set. You need to perform a redirect to refresh the full page as the method mentioned in this post
    https://blogs.oracle.com/jdevotnharvest/entry/how_to_efficiently_redirect_an

    ReplyDelete
    Replies
    1. Hello Mohammad,

      The code in post is worked well with me.
      Does it not work with you?

      Delete

ADF : Scope Variables

Oracle ADF uses many variables and each variable has a scope. There are five scopes in ADF (Application, Request, Session, View and PageFl...