Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms 在JSF ajax中执行其他表单字段值_Forms_Jsf_Submit - Fatal编程技术网

Forms 在JSF ajax中执行其他表单字段值

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="

考虑以下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="@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"/>