4 Replies Latest reply on Jan 10, 2012 6:36 AM by Sreenivasulu N

    How to open separate new window using h:commandButton Or a4j:commandButton

    Sreenivasulu N Newbie

      I am trying to open separate new window using h:commandButton. But by using following code, i am not able to open separate new window.


      My Jsp Code:


      <h:commandButton id="genReport"

                                  value="Generate Report" action="#{reportBean.generateReport}">




      Bean Code:


      HttpServletResponse res =


                      res.getWriter().println("<script>window.open('" +

                                              reportURL.toString() + "');</script>");




      Please anyone give me clarification.


      Thanks in advance.