I think is not a nested form.
This is a simplification of my situation (following the link you provided).
I use PrimeFaces 5.3, MyFaces 2.2x and no warnings/errors/exceptions are shown in the javascript console or on the server
rootPage.xhtml
Code: Select all
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:portlet="http://java.sun.com/portlet_2_0"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:portlet-client-model="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
xmlns:p="http://primefaces.org/ui" xmlns:tag="http://facelet/taglib"
xmlns:component="http://java.sun.com/jsf/composite/component">
<p:outputPanel id="containerForm">
<h:form id="flowForm">
<ui:include src="form#{prova.step}.xhtml" />
<p:commandButton value="continua" update="flowForm"
action="#{prova.nextForm}" />
</h:form>
</p:outputPanel>
</ui:composition>
form1.xhtml
Code: Select all
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:portlet="http://java.sun.com/portlet_2_0"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:portlet-client-model="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
xmlns:p="http://primefaces.org/ui" xmlns:tag="http://facelet/taglib"
xmlns:component="http://java.sun.com/jsf/composite/component">
<h:inputText value="#{prova.s1}" />
</ui:composition>
form2.xhtml
Code: Select all
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:portlet="http://java.sun.com/portlet_2_0"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:portlet-client-model="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
xmlns:p="http://primefaces.org/ui" xmlns:tag="http://facelet/taglib"
xmlns:component="http://java.sun.com/jsf/composite/component">
<h:inputText value="#{prova.s2}" />
</ui:composion>
Prova.java
Code: Select all
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean(name = Prova.MB_PROVA)
@RequestScoped
public class Prova implements Serializable {
private static final long serialVersionUID = -8626311413217069298L;
protected static final String MB_PROVA = "prova";
private String s1;
private String s2;
private int step = 1;
public String getS1() {
return s1;
}
public void setS1(String s1) {
this.s1 = s1;
}
public String getS2() {
return s2;
}
public void setS2(String s2) {
this.s2 = s2;
}
public int getStep() {
return step;
}
public void setStep(int step) {
this.step = step;
}
public void nextForm(){
setStep(getStep() + 1);
}
}
I think this is a working example
So, the first form works as expected, but after the update of the form, the second form is correctly displayed but the button action is not called anymore.
Thanks and I'm sorry if I wasn't clear before.