Wed. Jan 26th, 2022

Requirement: I want to programmatically Refresh a page in Oracle ADF.

Solution: For solution of the above requirement we will write a Java method which will Refresh the page. Thus, the Java method is as shown below:

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

Please using the below import statements:

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

Hence, the solution to our requirement.

If you like the post please comment, share, and do join me on Facebook. Please subscribe to my YouTube Channel for video tutorials.

Thanks & Regards,
Susanto Paul

 826 total views,  2 views today

By Susanto Paul

Susanto is an Oracle ACE, a qualified MCA, MBA, and a highly-skilled Senior Oracle Specialist. He is an enthusiastic Blogger and YouTuber who helps learners to solve their complex problems more efficiently. He has 9+ years of experience in multiple technologies like AWS, Oracle ADF, Oracle APEX, Oracle JET, Oracle VBCS, Oracle IDCS, Oracle PL/SQL, Oracle Integration Cloud, Java, JDBC, Servlets, JSP, Spring, Hibernate, HTML5, CSS3, JavaScript, TypeScript, NodesJS, Angular, MySQL, Oracle WebLogic Server, JUnit, JMeter, Selenium Web Driver, etc. He is a certified: Oracle Certified Professional Java SE 6 Programmer, Oracle ADF 11g Certified Implementation Specialist, Oracle Cloud Platform Application Integration 2020 Certified Specialist, Oracle Cloud Infrastructure Foundations 2020 Certified Associate, and Oracle Cloud Infrastructure Developer 2020 Certified Associate

Leave a Reply

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

satta king chart