当我提交表单时,它应该调用另一个表单以便我可以呈现它。我使用 primefaces,我希望它能够像下面这样工作。但它抛出了一个错误。
xhtml
<h:form id="from1">
<h:inputText=......
<h:outputText=....
<p:commandButton id="submit" actionlistener="#{bean.method}" value="submit" process="form2"/>
<h:form id="form2">
<h:outoutText value="it is working" render="#{bean.boolean}" />
</h:form>
错误
[Faces Servlet]] (http--127.0.0.1-8080-2) Servlet.service() for servlet Faces Servlet threw exception: javax.faces.FacesException: Cannot find component with identifier "form2" referenced from "form1_submit".
更新
<h:form id="from1">
<h:inputText=......
<h:outputText=....
<p:commandButton id="submit" actionlistener="#{bean.method}" value="submit" update=":form1"/>
</h:form>