JSF 2.0以&lt; F:AJAX执行=&QUOT; @所有&QUOT; /&GT; [英] JSF 2.0 with <f:ajax execute="@all" />
问题描述
抱歉,如果我被厚,但究竟是在F执行=@全:AJAX标签真的该怎么办?我希望它提交的所有元素在页面上,但它似乎只张贴在封闭形式的数值,并非所有形式的页面上。
sorry if I am being thick but what is the execute="@all" in an f:ajax tag really supposed to do? I expected it to submit all the elements on a page but it seems to POST only the values in the enclosing form, not all forms on page.
例如
<h:body>
<h:form id="form1">
Input1/Form1 <h:inputText id="testinput" value="#{testBean.input1}" />
</h:form>
<h:form id="form2">
Input2/form2 <h:inputText id="testinput2" value="#{testBean.input2}" />
<h:commandButton value="Ok" actionListener="#{testBean.al}">
<f:ajax execute="@all" />
</h:commandButton>
</h:form>
</h:body>
只有窗口2被张贴上点击。
Only form2 is posted on click.
使用mojarra 2.0.2 ..
Using mojarra 2.0.2..
推荐答案
下面是从的JavaServer报价面临2.0 - 的完整参考,第352页:
Here is a quote from JavaServer Faces 2.0 - The complete reference, page 352:
在执行和渲染关键字接受一组特殊的关键字,每个在此表中显示的含义:
The execute and render keywords accept a set of special keywords, each with the meaning shown in this table:
@All(与使用执行
):在页面上的每个组件都的提交和处理。当你想要做一个整版提交这是非常有用的。
@all (using with execute
): Every component on the page is submitted and processed. This is useful when you want to do a full-page submit.
我觉得这很清楚地指出,免遭一切形式的领域应与AJAX请求被提交。
I think this quite clearly states that the fields from all forms should be submitted with the AJAX request.
然而,即使使用Mojarra 2.0.3不会发生这种情况。尽管在执行
属性的内容(是否把表单列表或 @all
)中,只有封闭的形式得到它的'域提交。因此,这似乎是一个错误。我提出一个问题,关于这一点,除非有改变看法?
However, even with Mojarra 2.0.3 this doesn't happen. Despite of contents of the execute
attribute (whether you put a list of forms or @all
) only the enclosing form gets its' fields submitted. So this seems like a bug. I am raising an issue about this unless there are altering views?
这篇关于JSF 2.0以&lt; F:AJAX执行=&QUOT; @所有&QUOT; /&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!