Sunday, 9 March 2014

Call JavaScript from bean in ADF page

This blog we will see how to call java script from bean in ADF page.

In real life scenario, sometimes it is required to use JavaScript from backing bean. The below code is the call JavaScript from bean in ADF page.

FacesContext facesContext = FacesContext.getCurrentInstance();
org.apache.myfaces.trinidad.render.ExtendedRenderKitService service = org.apache.myfaces.trinidad.util.Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);

service.addScript(facesContext, "alert('Hello!!!');window.close();");

Thanks...

No comments:

Post a Comment