title: Primefaces dialog + commandButton
body: <p>I'm trying to use primefaces <code>&lt;p:dialog&gt;</code> combined with <code>&lt;p:commandButton&gt;</code>. In my .xhtml page I have a picklist and commandButton which is used to show a dialog. Dialog displays datatable with target values from picklist. Dialog has two buttons: cancel and submit. My problem is that submit button is not fired. What's strange, commandButton out of dialog works.</p>
  
  <p>Here's my .xhtml:</p>
  
  <pre><code>&lt;body&gt;
     &lt;ui:composition template="./../resources/mainTemplate.xhtml"&gt;
          &lt;ui:define name="content"&gt;
              &lt;h:form&gt;
                  &lt;p:dialog id="dlg" header="#{messages.chooseSkillLevel}" widgetVar="dlg" modal="true" dynamic="true"&gt;
                      &lt;h:dataTable value="#{editSkills.skillsAndLevels}" var="skillslevel"&gt;
                          &lt;h:column&gt;
                              #{skillslevel.skill.umiejetnosc}
                          &lt;/h:column&gt;
                          &lt;h:column&gt;
                              &lt;p:selectOneMenu value="#{skillslevel.level}" &gt;
                                  &lt;f:selectItems value="#{editSkills.levels}" var="level" itemLabel="#{level.stopien}" itemValue="#{level.id}" /&gt;
                              &lt;/p:selectOneMenu&gt;
                          &lt;/h:column&gt;
                      &lt;/h:dataTable&gt;
                      &lt;p:commandButton value="#{messages.confirm}" action="#{editSkills.showSkillsAndLevels}" oncomplete="dlg.hide();" /&gt;   THIS BUTTON IS NOT FIRED
                      &lt;p:commandButton value="#{messages.cancel}" onclick="dlg.hide()"/&gt;
                  &lt;/p:dialog&gt;
                  &lt;p:pickList value="#{editSkills.skills}" var="skill" effect="none"  
                  itemValue="#{skill.id}" itemLabel="#{skill.umiejetnosc}"  
                  showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" 
                  addLabel="#{messages.add}" removeLabel="#{messages.remove}" removeAllLabel="#{messages.removeAll}" &gt;  
                      &lt;f:facet name="sourceCaption"&gt;#{messages.skillsList}&lt;/f:facet&gt;  
                      &lt;f:facet name="targetCaption"&gt;#{messages.yourSkills}&lt;/f:facet&gt;
                      &lt;p:ajax event="transfer" listener="#{editSkills.onTransfer}" /&gt; 
                      &lt;p:column style="width:100%;"&gt;  
                          #{skill.umiejetnosc}  
                      &lt;/p:column&gt; 
                  &lt;/p:pickList&gt;
                  &lt;p:commandButton value="#{messages.confirm}" action="#{editSkills.afterSubmit}" update="dlg" oncomplete="dlg.show()" /&gt;   THIS BUTTON WORKS FINE
                  &lt;p:commandButton value="#{messages.cancel}" action="profile" immediate="true"/&gt;
             &lt;/h:form&gt;
          &lt;/ui:define&gt;
      &lt;/ui:composition&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I've marked working button and not working one.
  What do I have to do to make it working?</p>