Monday, July 4, 2016

To Show Pop Up using JavaScript

showPopup(Addpop, true);
Now we call it on button click, and pass the binding of Popup in it as we have Popup with binding AddPop then on Button click we call this method as 
private void showPopup(RichPopup pop, boolean visible) {
 try { FacesContext context = FacesContext.getCurrentInstance(); 
if (context != null && pop != null) {
 String popupId = pop.getClientId(context); 
if (popupId != null) { StringBuilder script = new StringBuilder(); 
script.append("var popup = AdfPage.PAGE.findComponent('").append(popupId).append("'); ");
 if (visible) {
 script.append("if (!popup.isPopupVisible()) { ").append("popup.show();}"); }
 else { 
script.append("if (popup.isPopupVisible()) { ").append("popup.hide();}"); } ExtendedRenderKitService erks = Service.getService(context.getRenderKit(), ExtendedRenderKitService.class); 
erks.addScript(context, script.toString()); 
} } } 
catch (Exception e) 
{ throw new RuntimeException(e); } } - 



See more at: http://www.awasthiashish.com/2012/11/popup-component-in-oracle-adf.html#sthash.5bExH7EZ.dpuf

No comments:

Post a Comment