title: Opening a new window by clicking <p:commandButton> in JSF
body: <p>I am trying to open a new pop up window by clicking a button <code>&lt;p:commandButton&gt;</code> in JSF.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>&lt;h:inputText style="width:42%"value="#{xxbean.values}" rendered="#{xxBean.yy == true}" 
       onblur="cc;" maxlength="6"&gt;
  &lt;/h:inputText&gt; 
  &lt;p:commandButton value="FindPhone" id="xxne" actionListener="#{xx.findPhoneSearch}"
      oncomplete="window.open('#{xx.wpUrl}', '_blank')" 
      rendered="#{xx.editCmdActionflg == true }"  async="false"&gt;
      &lt;f:param name="pmid" value="#{xx.Details.uid}"/&gt;                                   
  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p>I am calling he method findPhoneSearch like the one given above in actionlistener inside the command button ,</p>
  
  <p>Here is the findPhoneSearch method ,</p>
  
  <pre><code>public void FindphoneSearch(ActionEvent event) {
  
  
  
          String param = "";
  
          Map&lt;String, String&gt; params = FacesContext.getCurrentInstance()
                  .getExternalContext().getRequestParameterMap();
  
          String expression = "^[a-z0-9]+$";
          Pattern pattern = Pattern.compile(expression);
  
          if (params.get("pmid") != null) {
              String t_pmid = params.get("pmid");
              Matcher matcher = pattern.matcher(t_pmid);
              if (matcher.matches()) {
                  param = "/cgi-bin/Findphones.pl?id=" + t_pmid.trim();
              }
          }
  
          if (params.get("lpid") != null) {
              String t_lpid = params.get("lpid");
              Matcher matcher = pattern.matcher(t_lpid);
              if (matcher.matches()) {
                  param = "/cgi-bin/Findphones.pl?id=" + t_lpid.trim();
              }
          }
  
          String findphoneUrl= "http://Findphone.com" + param;
          wpUrl = findphoneUrl;
  
  
      }
  </code></pre>
  
  <p>My problem is the window is open blank without passing the url that I am framing which is assigned in wpurl.</p>
  
  <p>Please help me to resolve this issue.</p>