Refreshing the page by java mehtod in Oracle ADF

By Vinay | May 19, 2009 | 1,191 views
Category Common, Java, Oracle ADF


About author  I am Java/oracle professional.Working on Java/J2EE technologies and i.e Oracle ADF,Spring,hibernate,J2ee,PL/sql,Apps for 2+ years.I am passionate about learning new technologies.I am sharing my knowledge. Give your views and suggestion. http://www.linkedin.com/in/vinaykumar2 Read more from this author


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.

Read more post on Refreshing the page by java mehtod in Oracle ADF 

3 comments | Add One

Comments

  1. HusainNo Gravatar - 05/29/2009 at 9:55 am

    Hi Vinay,

    Great Article !
    Cant we also use the refresh attribute of iterator in page definition to do something similar?



  2. vinayNo Gravatar - 05/31/2009 at 12:46 am

    yes we can use.But that will work only to refresh the iterator.This method will refresh the whole page.

    Let me know if you have any doubt.



  3. SM ShohidNo Gravatar - 11/3/2009 at 10:01 pm

    Hi Vinay…
    I need auto refreshment with the server data in a whole page in 1 Minute interval.. I m new in Oracle adf.. can u help me regarding this… Thanks in advance..



Trackbacks

Leave a Comment

Name:

E-Mail :

Website :

Comments :