Sunday, November 14, 2010

Show pop up from manage bean

 public static void showPopup(String clientId)
{
   FacesContext context = FacesContext.getCurrentInstance();
   StringBuilder script = new StringBuilder();
   script.append("var popup = AdfPage.PAGE.findComponent('")
            .append(clientId)
            .append("'); ")
            .append("if (!popup.isPopupVisible()) { ")
            .append("popup.show();}");
  ExtendedRenderKitService erks = Service.getService(context.getRenderKit(),
                                                       ExtendedRenderKitService.class);
  erks.addScript(context, script.toString());
}

clientId - The component id of the pop up.

No comments:

Post a Comment