The following simplificated Code is working when I set ajax="false". With ajax="true" the second commandButton don't calls personPM.commitEditPerson() when pushed after was updated by Button1 or Button2.
Can someone help me whats wrong here? Because it seems to be not easy to solve, I add the whole code that it can be easily reproduced (JSF 2.2, Primefaces is 3.5, GlassFish 4.0):
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form id="f1">
<p:commandButton id="Button1" update=":neuePerson" value="Neue Person" action="#{testPM.setCurrentPerson()}"/>
</h:form>
<h:panelGroup id="neuePerson">
<h:form id="f2" >
<p:commandButton id="Button2" update=":neuePerson" value="Übernehmen" action="#{testPM.commitEditPerson()}"/>
</h:form>
</h:panelGroup>
</h:body>
</html>
Session Scoped Bean TestPM.java:
package at.feimas.administration.presentation;
import java.util.logging.Level;
import java.util.logging.Logger;
public class TestPM {
private String currentPerson;
private String firstName;
private static final Logger logger = Logger.getLogger(TestPM.class.getName());
public void setCurrentPerson() {
logger.log(Level.INFO, "New Person");
}
public void commitEditPerson(){
logger.log(Level.INFO, "Edit Person");
}
}