-1

我升级到 jsf 2.2 和 primefaces 3.5(在 maven repo 中找不到 3.5.7)

我有一些页面更新了表单元素

<h:form id="myform">
         <p:commandButton update="myform" />
</h:form>

这在第一次加载到

<form enctype="application/x-www-form-urlencoded" action="/Brainyoo2/pages/test.html?conversationContext=2" method="post" name="myform" id="myform">
    <input type="hidden" value="myform" name="myform">
    <button type="submit" onclick="PrimeFaces.ab({source:'myform:j_idt33',update:'myform'});return false;" class="" name="myform:j_idt33" id="myform:j_idt33" role="button" aria-disabled="false">
        <span class="ui-button-text ui-c">ui-button</span>
    </button>
    <input type="hidden" autocomplete="off" value="2334157823875715239:-6429653122802219998" id="j_id1:javax.faces.ViewState:0" name="javax.faces.ViewState">
</form>

单击按钮后,它按 ajax 呈现到

<form enctype="application/x-www-form-urlencoded" action="/Brainyoo2/pages/test.html?conversationContext=2" method="post" name="myform" id="myform">
    <input type="hidden" value="myform" name="myform">
    <button type="submit" onclick="PrimeFaces.ab({source:'myform:j_idt33',update:'myform'});return false;" class="" name="myform:j_idt33" id="myform:j_idt33" role="button" aria-disabled="false">
        <span class="ui-button-text ui-c">ui-button</span>
    </button>
</form>

表示 ViewState 丢失,并且不再发送请求。当我用一个实现这个例子时

<h:commandButton and <f:ajax

有用。

我已经尝试过 '4.0-SNAPSHOT' 但它有同样的问题

任何想法如何在不更改每个 html 页面的情况下修复它?

4

1 回答 1

0

你尝试@form更新

于 2013-06-28T11:42:24.027 回答