title: Pass parameter to dialog in the same page
body: <p>I have a page contains a form and other form nested in a dialog.
  I need to pass parameter to dialog when button clicked in the main form</p>
  
  <pre><code>&lt;h:form&gt;
  &lt;p:dataTable var="form" value="#{myBean.formList}"&gt;
       &lt;p:commandButton id="selectProduct" 
                              update="selectProductForm" oncomplete="selectProductDlg.show()" 
                              image="ui-icon-" &gt; 
                              &lt;f:param name="formId" value="#{form.id}" /&gt;
                  &lt;/p:commandButton&gt;
  &lt;/p:dataTable&gt;
  &lt;/h:form&gt;
  
  &lt;p:dialog&gt;
  ...&lt;h:form&gt;
  &lt;p:commandButton action="#{myBean.setSelected}"
                      update="main_form"
                      oncomplete="if(#{myBean.errorText == 'SUCCESS'}){ selectProductDlg.hide();}"
                      value="Sec"&gt;
                  &lt;/p:commandButton&gt;
  </code></pre>
  
  <p><br>
   </p>
  
  <p>i can not see formId in myBean with code:</p>
  
  <pre><code>if (form == null) {
              HttpServletRequest req = (HttpServletRequest) FacesContext
                      .getCurrentInstance().getExternalContext().getRequest();
              if(req.getParameter("formId") != null) {
                  formId = Long.valueOf(req.getParameter("formId"));
              }
              if (formId != null &amp;&amp; !"".equals(formId)) {
                  form = formService.findById(formId);
              } 
          }
  </code></pre>
  
  <p>where am i wrong
  thanks</p>