Refreshing the page by java mehtod in Oracle ADF

In Oracle ADF, for refreshing the page after doing some operation in database we need to refresh the Page ,which is very needed to display the right content.For this we need to write java method in page.java file. Write that method anywhere in java file and call that method anywhere where you want to refresh the page.

protected void refreshPage() {
      FacesContext fc = FacesContext.getCurrentInstance();
      String refreshpage = fc.getViewRoot().getViewId();
 ViewHandler ViewH =                                                                                                                   
 fc.getApplication().getViewHandler();
      UIViewRoot UIV = ViewH.createView(fc refreshpage);
      UIV.setViewId(refreshpage);
      fc.setViewRoot(UIV);
}

This is only method you need to write to refresh the page.

Vinay

I am an Oracle ACE in Oracle ADF/Webcenter. Sr Java Consultant-working on Java/J2EE/Oracle ADF/Webcenter Portal/ content and Hibernate for several years. I'm an active member of the OTN JDeveloper/Webcenter forum. Passionate about learning new technologies. I am here to share my knowledge. Give your views and suggestion on [email protected] .

More Posts - Website

Follow Me:
TwitterLinkedInGoogle PlusYouTube