Posts

How to refresh a component in Oracle ADF Programmatically

 There are many scenarios when we have to refresh the UI Component or Values in any Component on the Page. We can achieve this functionality by using this code in the ADF Managed Bean. Step 1-  We need to create binding of the component which is to be refreshed. Step 2- Add this method in the Button Action Listener or Value Change Listener along with the created Binding name of the component. AdfFacesContext.getCurrentInstance().addPartialTarget(compBinding); //here compBinding is the Binding of the component

How to refresh page in Oracle ADF by using method

There are many scenarios when we have to refresh the Page by clicking on any Button or using Action Listener. We can achieve this functionality by using this code in the ADF Managed Bean.   Step 1- Add this given method in the bean and import the relvent methods private void refreshPage() { FacesContext fctx = FacesContext.getCurrentInstance(); String page = fctx.getViewRoot().getViewId(); ViewHandler ViewH = fctx.getApplication().getViewHandler(); UIViewRoot UIV = ViewH.createView(fctx, page); UIV.setViewId(page); fctx.setViewRoot(UIV); }   Step 2- After writting the method we have invoke that particular method in Acton Listner or wherevere we want. public void buttonAL(ActionEvent actionEvent) { refreshPage(); }