Forms 在JSF ajax中执行其他表单字段值
考虑以下JSF 2.x标记:Forms 在JSF ajax中执行其他表单字段值,forms,jsf,submit,Forms,Jsf,Submit,考虑以下JSF 2.x标记: <h:form id="form1"> <h:inputText id="input" value="#{testBacking.input}"/> </h:form> <h:form id="form2"> <h:commandButton value="go" action="#{testBacking.go()}"> <f:ajax execute="
<h:form id="form1">
<h:inputText id="input" value="#{testBacking.input}"/>
</h:form>
<h:form id="form2">
<h:commandButton value="go" action="#{testBacking.go()}">
<f:ajax execute="@all" render="output"/>
</h:commandButton>
<h:outputText id="output" value="#{testBacking.input}"/>
</h:form>
单击按钮后,输入值不会提交到服务器
有没有办法将输入值提交给服务器(同时以不同的形式保存输入)
如果您只能提交来自同一表单的字段,那么以下两种表单之间有什么不同
<f:ajax execute="@all" render="output"/>
<f:ajax execute="@form" render="output"/>
快速搜索
jsf execute=@all vs execute=@form
会得到一些结果:
本质上,JSF处理工作正常,但HTML只发送包含ajax的表单(我怀疑HTML为每个表单指定了单独的请求)。基本上,ajax标记中的@all参数似乎没有意义。
<f:ajax execute="@all" render="output"/>
<f:ajax execute="@form" render="output"/>