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.

Husain
Hi Vinay,
Great Article !
Cant we also use the refresh attribute of iterator in page definition to do something similar?
vinay
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.
SM Shohid
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..
vijay
Hi Vinay,
Its helped me to refresh the page..thanks..
Rocky
Hi Vinay,
Will this method work for oracle ADF 11g?
I see that this method was posted in the 2009.
Thanks
vinay
it will work
Rocky
Hi Vinay,
I am new to ADF.
- I have table, user_items with only one column product_key.
- I have another table, product_master which has product_key, product_name, description, uom, etc.
It has about 100000 records.
I am developing the jspx page where there is a single af:input text field.
In that textbox, user will enter the product_name textbox and clicks submit the button.
I need to get the product_key from product_master table and save it to user_items table.
—-
I created 2 EOs/VOs. One for each user_items and product_master tables.
Dragged the user_items datacontrol on the jsp page and made the product_key text as hidden
Added the new textbox the component palette to enter product_name. Auto suggest feature is not
a good idea as there 100000 records in that table. So, from the valueChangeListener I want
to call the bean to get the product_id and assign to hidden input box so that when the
user clicks submit it will saved in the user_items table automatically.
Is it possible to do it in the bean like I mentioned above?
Thanks
vinay
well i don’t think that this is best way to do.and i am not sure whther it will work or not.create procedure in pl/sql which have one parameter and whose functionality is as to insert record in user_item table.this is best way to do so..
you just need to pick the value from input text and pass into the parameter of procedure .call the procedure calling method in bean………….
Nidhi
Hi Vinay,
My use case is to refresh the page when browser is refreshed.
I want to call this method when browser refresh happens.
How can I solve this issue?
Thanks
vinay
well.. not sure.can you let me know the exact scenario.so that i can help you much better